Posts under category Google

I am working with Google Ads and taking look in the documentation to see how to code a campaign.

from google.ads.google_ads.client import GoogleAdsClient def create_campaign(google_ads_client, campaign_name, budget_micros):     campaign_operation = google_ads_client.service.campaign.create(         customer_id="YOUR_CUSTOMER_ID",         campaign={             "name": campaign_name,             "advertising_channel_type": "SEARCH",             "status": "PAUSED",             "manual_cpc": {                 "enhanced_cpc_enabled": True             },             "campaign_budget": {                 "amount_micros": budget_micros             },             "network_settings": {                 "target_google_search": True,                 "target_search_network": True,                 "target_content_network": False,                 "target_partner_search_network": False             }         }     )     # Execute the campaign operation     response = campaign_operation.execute()     # Print the created campaign's resource name     print("Created campaign with resource name: " + response.resource_name) # Set up the Google Ads API client google_ads_client = GoogleAdsClient.load_from_storage() # Define the campaign details campaign_name = "My Campaign" budget_micros = 5.000000   

The error raised with macro budget and I don't know what is this, I tried set the number based on what documentation suggesting and still don't understand it

First of all, thanks for any help I can get here. I am not a professional and now, unfortunately, after many hours I just can't get any further.

I run a Woocommerce webshop and have integrated GA4 and Google Adwords Conversion + Remarketing via Tag Manager. In preview mode all tags and data layers are loaded correctly. But the Goolge Ads Remarketing Tag and the Conversion Tag are marked red and loaded but not sent.

The Error Message in Tag Manager Browser Plugin: HTTP response code indicates tag failed to fire: Status 400:

Google Tag Assistant - Conversion failed to fire

The Code in GTM Preview Mode when Remarketing Tag is fired ( everythings looks good ):

GTM - Preview - Remarketing Values

If i open Dev Tool on my Browser i see that some google Scripts are red ( Url = googleads.g.doublecklick...... ):

Google ads url is blocked

Unfortunately no conversions are recorded in Adwords and the imported conversions from GA4 are also counted only to a small amount. With the old Analytics UA I had no problems and almost all the conversions were displayed in Adwords.

GTM is published and i have no Ad Blockers running.

Conversion ID and Label is checked

The Google Ads Campaigns are running

I turned off the GTM plugin for wordpress and tried a paid plugin for google ads conversion tracking. Unfortunately i have had the same error.

In addition, I turned of almost all plugins and tested whether anything blocks. Unfortunately without result.

If I change the conversion ID in the remarketing tag and add "AW-", the tag is no longer displayed as red. However, I can not change the conversion tag because only numbers are allowed:

Trying Conversion ID with "AW-" in Remarketing Tag

I'm realy a bit desperate and really grateful for any ideas!

I am struggling with implement google native ads on web, i tired to find some documentation on google site, but all refers to mobile app. Has anyone perhaps implemented this?

Already what i do:

  1. I dig through the google documentation
  2. Ask chat GPT :) , give me few useless info
  3. Some tests with google ads events etc.

I created new credentials in Google Developer Console for Google Ads base URL : https://googleads.googleapis.com/v14/customers. and added the scope: https://www.googleapis.com/auth/adwords . Using Oauth2 user consent. https://developers.google.com/identity/protocols/oauth2

In Postman, I performed the following steps in my Google Ads workspace :

1a. Added Client Id and Client Secret to the variables portion of the Google Ads collection.

  1. Set the token name
  2. Set the grant type = 'Authorization Code'
  3. Callback URL = https://oauth.pstmn.io/v1/browser-callback
  4. Auth URL = https://accounts.google.com/o/oauth2/v2/auth
  5. Access Token URL = https://oauth2.googleapis.com/token
  6. Scope = https://www.googleapis.com/auth/adwords
  7. Refresh token (default) = https://oauth2.googleapis.com/token

When I click the Access New Token button, I get the redirect page requesting me to choose an account. So I choose my google account and allow oauth.pstmn.io to access my google account (This is postman browser) .

The token generation fails with the message below (note that I have already successfully done token generation in Postman with credentials used for DFA Reporting for Campaigns, Sites, and Ads in GCM 360):

However, the result is that I get an "invalid client". How could that be since I created the client in Google Developer Console and copied those over to Postman doing everything that I did successfully for GCM 360 APIs ? Thanks. Here are the slides:

Google Sensitive scopes List

Postman Redirect

Postman Error Logs

Response body (in error log)

I'm attempting to cURL the Google Ads API with the following PHP code:

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://googleads.googleapis.com/v14/customers/[CUSTOMER_ID]:generateKeywordHistoricalMetrics'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($ch, CURLOPT_HTTPHEADER, [     'developer-token: [DEVELOPER_TOKEN',     'login-customer-id: [LOGIN_CUSTOMER_ID]',     'Authorization: Bearer [???????]',     'Accept: application/json',     'Content-Type: application/json', ]); curl_setopt($ch, CURLOPT_POSTFIELDS, '{"historicalMetricsOptions":{"yearMonthRange":{"start":{"month":"JUNE","year":2022},"end":{"month":"MAY","year":2023}}},"keywords":[""]}'); $response = curl_exec($ch); curl_close($ch); 

And the response is:

{   "error": {     "code": 401,     "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",     "status": "UNAUTHENTICATED"   } } 

What I believe the issue to be is on the "Authentication" field. So far, I've put the following in that field(and failed each time):

  1. OAUTH 2 Client ID
  2. OAUTH 2 Client Secret
  3. OAUTH 2 Refresh Token, that works for another Google Ads project I've made
  4. Developer token

So, I could appreciate any and all help, since I'm running out of ideas and don't know what to do.