Posts tagged with api

I have created a test account in https://console.cloud.google.com/

I followed the instructions in the following link: OAuth Web Application Flow

All went ok till Step 3 - Generating a refresh token. In Step 3: sub steps 1-4 went ok as describe in the link.

But on sub step 5 I am getting :

The authentication flow has completed. You may close this window.

and in my cmd I see:

Access token: XXXXXXXXXX Refresh token: None

Can someone please help me to understand what am I doing wrong?

Thanks,

Nir

I use the Google AdWords API to collect information about the search volume for a specific keyword. But the data I get as a response doesn't match with the data from the keyword planner or other keyword tools. Here I check the search volume for the keyword "Hunde" in Berlin, Germany in german.

targeting_service = adwordsClient.GetService('TargetingIdeaService') selector = {'ideaType': 'KEYWORD', 'requestType' : 'STATS'} selector['requestedAttributeTypes'] = ['KEYWORD_TEXT', 'SEARCH_VOLUME', 'TARGETED_MONTHLY_SEARCHES'] offset = 0 selector['paging'] = {'startIndex' : str(offset), 'numberResults' : str(1)} selector['searchParameters'] = [{    'xsi_type': 'RelatedToQuerySearchParameter',    'queries': ["hunde"] }] selector['searchParameters'].append({    'xsi_type': 'LocationSearchParameter',    'locations': [{'id': '1003854'}] }) selector['searchParameters'].append({    'xsi_type': 'LanguageSearchParameter',    'languages': [{'id': '1001'}] }) page = targeting_service.get(selector) print(page) 

As a response I get:

{     'totalNumEntries': 1,     'entries': [         {             'data': [                 {                     'key': 'KEYWORD_TEXT',                     'value': {                         'Attribute.Type': 'StringAttribute',                         'value': 'hunde'                     }                 },                 {                     'key': 'TARGETED_MONTHLY_SEARCHES',                     'value': {                         'Attribute.Type': 'MonthlySearchVolumeAttribute',                         'value': [                             {                                 'year': 2020,                                 'month': 12,                                 'count': 4743382                             },                             {                                 'year': 2020,                                 'month': 11,                                 'count': 455583                             },                             {                                 'year': 2020,                                 'month': 10,                                 'count': 8797951                             },                             {                                 'year': 2020,                                 'month': 9,                                 'count': 5218694                             },                             {                                 'year': 2020,                                 'month': 8,                                 'count': 5089585                             },                             {                                 'year': 2020,                                 'month': 7,                                 'count': 3149591                             },                             {                                 'year': 2020,                                 'month': 6,                                 'count': 3020638                             },                             {                                 'year': 2020,                                 'month': 5,                                 'count': 4928527                             },                             {                                 'year': 2020,                                 'month': 4,                                 'count': 754959                             },                             {                                 'year': 2020,                                 'month': 3,                                 'count': 5649676                             },                             {                                 'year': 2020,                                 'month': 2,                                 'count': 1590789                             },                             {                                 'year': 2020,                                 'month': 1,                                 'count': 2506674                             }                         ]                     }                 },                 {                     'key': 'SEARCH_VOLUME',                     'value': {                         'Attribute.Type': 'LongAttribute',                         'value': 3825504                     }                 }             ]         }     ] } 

But this data doesn't match with the data from the keyword planer.
Avg. monthly searches (Keyword planner): 10K – 100K

Does somebody knows why the data I'm receiving is wrong?

Google has the following docs for the ad manager here. Unfortunately their example:

# Set the start and end dates of the report to run (past 8 days). end_date = date.today() start_date = end_date - timedelta(days=8) # Create report job. report_job = {     'reportQuery': {         'dimensions': ['LINE_ITEM_ID', 'LINE_ITEM_NAME'],         'columns': ['AD_SERVER_IMPRESSIONS', 'AD_SERVER_CLICKS',                     'AD_SERVER_CTR', 'AD_SERVER_CPM_AND_CPC_REVENUE',                     'AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM'],         'dateRangeType': 'CUSTOM_DATE',         'startDate': start_date,         'endDate': end_date     } } # Initialize a DataDownloader. report_downloader = client.GetDataDownloader(version='v202008') try:   # Run the report and wait for it to finish.   report_job_id = report_downloader.WaitForReport(report_job) except errors.AdManagerReportError as e:   print('Failed to generate report. Error was: %s' % e) with tempfile.NamedTemporaryFile(     suffix='.csv.gz', mode='wb', delete=False) as report_file:   # Download report data.   report_downloader.DownloadReportToFile(       report_job_id, 'CSV_DUMP', report_file) 

yields a KeyError: 'date' on the report_job_id line. My authorization is correct and I can make other calls with my client. My question is, how does one need to update report_job in order for the example to work. I tried changing 'dateRangeType' however this states it must be 'CUSTOM_DATE'.