Posts tagged with google-ads-api

I am trying to solve error from firefox console:

The resource from “https://googleads.g.doubleclick.net/pagead/viewthroughconversion/973891309/?random=1655454537427&cv=9&fst=1655454537427&num=1&guid=ON&resp=GooglemKTybQhCsO&eid=375603261&u_h=1080&u_w=1920&u_ah=1040&u_aw=1920&u_cd=24&u_his=5&u_tz=120&u_java=false&u_nplug=0&u_nmime=0&sendb=1&ig=1&frm=0&url=https%3A%2F%2Fwww.gm.gama-sklep.com.pl%2F&tiba=Meble%20-%20Internetowy%20Sklep%20Meblowy%20Gama&hn=www.googleadservices.com&rfmt=3&fmt=4” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).

In previous topics on this forum usually problem was with script url and type but in this situation above url is called from google tag manager script which is delivered from google. Base script is typical for gtm and looks like this:

<!-- Google Tag Manager --> <script>     (function (w, d, s, l, i) {         w[l] = w[l] || [];         w[l].push({             'gtm.start':                 new Date().getTime(), event: 'gtm.js'         });         var f = d.getElementsByTagName(s)[0],             j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';         j.async = true;         j.src =             'https://www.googletagmanager.com/gtm.js?id=' + i + dl;         f.parentNode.insertBefore(j, f);     })(window, document, 'script', 'dataLayer', 'GTM-NXQN6F4'); </script> <!-- End Google Tag Manager --> 

Similar situation is when i try to add remarketing tag without gtm using js code from ads panel:

    <!-- Global site tag (gtag.js) - Google Ads: 482376610 --> <script async src="https://www.googletagmanager.com/gtag/js?id=AW-482376610"></script> <script>   window.dataLayer = window.dataLayer || [];   function gtag(){dataLayer.push(arguments);}   gtag('js', new Date());   gtag('config', 'AW-482376610'); </script> 

Above code will also report 400 error + mime type error.

Is this a problem releated to server?

I am getting a USER_PERMISSION_DENIED error while making google ads API call. Upon googling I got to know that we need to pass login customer id and client customer id while making API call?

  1. I want to understand what is the difference between login customer id and client customer id?
  2. How do I get login customer id and client customer id ?
  3. When do I have to use both login customer id and client customer id while making API call? Some sample code examples to use both login customer id and client customer id using java library would be helpful

I was asked to call Google-Ads API in order to create a report with these fields:

I went to ad_group_ad table.

I wanted to make sure I understand this table's meaning: Why isn't this just called Ad?

What is the difference between Ad_group_ad and Ad_group tables?

There were a few metrics which I couldn't find in ad_group_ad I couldn't filter the views which contain them (for example impression_share)

I know impression_share exists for keywords and campaign, so I found them in the relevant tables. So I understand they cannot be broken down at an ad level.

But I still couldn't find the other highlighted metrics even at a campaign level.

Here is my campaign query try:

SELECT    metrics.clicks,    metrics.impressions,    metrics.ctr,    metrics.cost_micros,    metrics.cost_per_conversion,    metrics.cost_per_all_conversions,    metrics.all_conversions_from_interactions_rate,    metrics.all_conversions_value,    campaign.name,    campaign.id,    segments.device,    segments.date,    campaign.advertising_channel_type,    segments.click_type,    campaign.geo_target_type_setting.positive_geo_target_type,    campaign.geo_target_type_setting.negative_geo_target_type  FROM campaign  WHERE    segments.date BETWEEN '2020-01-01' AND '2022-01-01'  ORDER BY    campaign.start_date DESC  LIMIT 100  

I got this Fatal Error/Uncaught Error while linking with the Google Ads API. I've used the Github code and downloaded library from composer

Fatal error: Uncaught Error: Class "Google\Ads\GoogleAds\Examples\Utils\ArgumentParser" not found in googleAdword\examples\BasicOperations\GetCampaigns.php:44 Stack trace: #0 googleAdword\examples\BasicOperations\GetCampaigns.php(120): Google\Ads\GoogleAds\Examples\BasicOperations\GetCampaigns::main() #1

Tried all these solutions:

  1. reinstalling the lib, and not through zip downloading at first, but through git clone, and then install through composer etc.
  2. In the sample code of GetAccountInformation, there is a CUSTOMER_ID field that is required before you execute the code.(Already set)