Posts under category Google

We started to use Google Ads API V9 instead of Google Adwords API. In Google Adwords API there was status DISABLED for the conversion tracker. Now there is HIDDEN and REMOVED for conversion action. When we try to set HIDDEN or REMOVED there is an error message:

REMOVED-"Enum value 'REMOVED' cannot be used."

HIDDEN-"The field's value is on a deny-list for this field."

Any ideas?

A system I need to install conversion tracking in does not allow for JavaScript but does allow for image pixels.

Do you know if this following script will be sufficient? I would replace the ID & Label placeholders with the actual references form the Ad Account

<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/1111111111/?label=2222222222&amp;guid=ON&amp;script=0"/> 

Regular HTMP Pixel

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

I'm trying to use keywords ideas with Google Ads API Rest Interface that the support provided me the curl example, I generate the access token and tested and it works!(by the way my main gole is to use curl php in the back end but i'm just testing with curl command for now) when I use this curl command to generate keywords ideas:

curl -i --request POST https://googleads.googleapis.com/v9/customers/8519781266:generateKeywordIdeas \ --header "Content-Type: application/json" \ --header "login-customer-id: 2260416591" \ --header "developer-token: EPJhOWi8NVNfcvFIoxY5LA" \ --header "Authorization: Bearer ya29.A0ARrdaM9BxaCZnArsoqMUdTMLLqimKRHTw1inCD2pjheLeRnVzV96Kxpag0pktYg8E0gHhjkD1SgKd3lExbCJQ5_KgLWibmW5ykfwCXiQp8ZB90CdtPvabPlKweToM6dYj8KnSn5mu2Z0uxkRIl2bpnFHtDUw2g" \ --data '{ "keywordSeed": { "keywords": [ "coffee" ] } }' 

It prints this error

{   "error": {     "code": 400,     "message": "Invalid JSON payload received. Closing quote expected in string.\n\n^",     "status": "INVALID_ARGUMENT"   } } 

I tried something else like getting the list of the accounts and it works

C:\Users\MostafaEzzat>curl -f --request GET "https://googleads.googleapis.com/v9/customers:listAccessibleCustomers" \ --header "Content-Type: application/json" \ --header "developer-token: EPJhOWi8NVNfcvFIoxY5LA" \ --header "Authorization: Bearer ya29.A0ARrdaM98bLbmUOuR431zfEPVpDoab8_sD0Mq8W4fhrHtrmgfX8nSaPyzcW1ooaIKRSQColaOCtsp-cYhgSxa9KPQ_RI4Ctv0o5L9jTA-VhDKweVHozpEWChqFpp4yihhQe3bfr1Fksxd5NCiWvUh1GWIaruNPA" \ {   "resourceNames": [     "customers/8519781266",     "customers/2260416591",     "customers/3084026203",     "customers/2897861276",     "customers/6210187694",     "customers/3242362947"   ] } 

I'm currently running a script locally to generate reports using GoogleAdsManager API. Prior running the script I've created new service account key in json format as the key type together with ~/googleads.yaml.

Here's the dev guide.

However, I wanted to schedule this script on (AWS Glue).

This is the sample script and the issue I currently faced is :

How do call this method ad_manager.AdManagerClient.LoadFromStorage() from aws? I've stored the credentials (JSON and YAML) in AWS Secrets Manager

from googleads import ad_manager, oauth2 import tempfile import _locale _locale._getdefaultlocale = (lambda *args: ['en_US', 'UTF-8']) ad_unit_id = XXXXXXXXXX def generate_ad_impressions(client):     # Initialize appropriate service.     report_service = client.GetService("ReportService",      version="v202108")     # Initialize a DataDownloader.     report_downloader = client.GetDataDownloader(version="v202108")     # Create statement object to filter for an order.     statement = (         ad_manager.StatementBuilder(version="v202108")         .Where("PARENT_AD_UNIT_ID = :id")         .WithBindVariable("id", mbns_aa_vod_ad_unit_id)         .Limit(None)  # No limit/offset for reports         .Offset(None)     )     report_job = {         "reportQuery": {         "dimensions": ["DATE", "HOUR"],         "columns": [             "AD_SERVER_IMPRESSIONS",         ],         "dateRangeType": "TODAY",         "startDate": {             "year": "2022",             "month": "1",             "day": "25"         },         "endDate": {             "year": "2022",             "month": "1",             "day": "25"         },         "statement": statement.ToStatement(),       }     }     try:         # Run the report and wait for it to finish.         report_job_id = report_downloader.WaitForReport(report_job)     except:         print("Failed to generate report.")         # Change to your preferred export format.         export_format = "CSV_DUMP"         # report_file =         tempfile.NamedTemporaryFile(suffix=".csv.gz",          delete=False)     with open('ad_unit_report.csv.gz', mode='wb') as report_file:         # Download report data.         report_downloader.DownloadReportToFile(report_job_id,          export_format, report_file)         report_file.close()     # Download report data.     downloaded_report =      report_downloader.DownloadReportToFile(report_job_id,      export_format, report_file)     report_file.close()     print('success!') if __name__ == '__main__':    ad_manager_client =     ad_manager.AdManagerClient.LoadFromStorage('path_to_yaml_file')    generate_ad_impressions(ad_manager_client)