How to get data from ads by phone number?

70 views
Skip to first unread message

shu...@mobistreak.com

unread,
Dec 16, 2016, 2:11:58 AM12/16/16
to AdWords API Forum
I am using download_criteria_report.py ( version='v201609' )

report = {
      'reportName': 'YESTERDAY AD_PERFORMANCE_REPORT',
      'dateRangeType': 'YESTERDAY',
      'reportType': 'AD_PERFORMANCE_REPORT',
      'downloadFormat': 'CSV',
      'selector': {
          'fields': ['Clicks', 'Impressions', 'Cost'],
          'predicates' : [{
              'field': 'CallOnlyAd.phoneNumber',                   # i also used CallOnlyAdPhoneNumber, CallOnlyPhoneNumber, CallOnlyAd but still same error
              'operator': 'EQUALS',
              'values': '16502531234'
          }]
      }
  }

Error : INVALID_PREDICATE_FIELD_NAME         Any help???



Joyce Lava

unread,
Dec 16, 2016, 2:21:00 AM12/16/16
to AdWords API Forum
Hello,

The field CallOnlyPhoneNumber should return the phone number of the call-only ad, however, this field is not filterable. That said, you cannot use it as a predicate. I recommend you add this field in the selected report fields and manually filter this number from the report spreadsheet generated.

Regards,
Joyce, AdWords API Team

shu...@mobistreak.com

unread,
Dec 16, 2016, 2:46:00 AM12/16/16
to AdWords API Forum
Hi,

Thanks for the instant reply. I got your point, i don't know why this thing is not mentioned anywhere in docs. Anyways i also want to know 

1) Instead of downloading the report can't i directly manipulate my data from the screen and use? 
2) Also lets say my cost is $269.48 but is shows 26948000 why? 
3) I see a tabular type data on my screen but only thing i want is the final data, for ex lets say total cost how can i get it?

Joyce Lava

unread,
Dec 16, 2016, 3:05:03 AM12/16/16
to AdWords API Forum
Hi,

In the docs, there is a field attribute called "Filterable". If the report field is set to Filterable = True, then you can use this field as a report predicate, otherwise, you can't use it as predicate. The field CallOnlyPhoneNumber is set to Filterable = False. 

Regarding your other concerns, please see my answers:

1) Instead of downloading the report can't i directly manipulate my data from the screen and use? 
Do you mean screen as the AdWords UI? If yes, please post this question to AdWords Community Forum as they are more equipped with the product-related concerns. 
 
2) Also lets say my cost is $269.48 but is shows 26948000 why? 
The Money (e.g. Cost) fields in reports are returned in micro currency units, that is, $1 will be returned as 1,000,000.
 
3) I see a tabular type data on my screen but only thing i want is the final data, for ex lets say total cost how can i get it?
If you are referring to AdWords UI as well in this question, please post it to AdWords Community Forum as well.
 

Joyce Lava

unread,
Dec 16, 2016, 3:43:29 AM12/16/16
to AdWords API Forum
Hi,

Apologies, I wanted to correct the answer:

The Money (e.g. Cost) fields in reports are returned in micro currency units, that is, 1 will be returned as 1000000.

Thanks,
Joyce, AdWords API Team

shu...@mobistreak.com

unread,
Dec 19, 2016, 3:42:34 AM12/19/16
to AdWords API Forum
Hi,

I mean when i hit the api from my platform i get the result on my terminal screen. Like below.


Now i want your help in few things :

  1. I have a main multiple manager accounts with multiple client accounts in it, each having different Customer Ids. So do i have to capture all Customer Ids and then loop over the code to fetch the result like i shown in pic or i can get all the result by using some technique. 
  2. Where can i find details about which function is for what like what does DownloadReport(), GetReportDownloader() etc do?
  3. Instead of downloading the report and reading it to get the data, can't i directly read the data from the screen (as shown in the pic) or put in some variable & use it or something? Help with code as i don't know python and adwords does not have Node.js API. i tried this but did not work. " data = report_downloader.DownloadReport(report) print data "




Message has been deleted
Message has been deleted

shu...@mobistreak.com

unread,
Dec 19, 2016, 4:06:56 AM12/19/16
to AdWords API Forum
Hi,

I am able to work on the 3rd point like this 
data = report_downloader.DownloadReportAsString(
      report, skip_report_header=False, skip_column_header=False,
      skip_report_summary=False)
  print data
 
But how to proceed further? I want cost group by phone numbers.

Joyce Lava

unread,
Dec 19, 2016, 4:23:26 AM12/19/16
to AdWords API Forum
Hi,

Yes, you may use the DownloadReportAsString to get the report data as String. An example code is available here. Regarding the phone numbers, GROUP BY clause is not supported in AWQL. Also, as discussed in my previous response, the field CallOnlyPhoneNumber could not be used as a predicate. 

Additionally, AdWords API does not support report requests for multiple clientCustomerId. You would have to submit a separate report request for each client account to generate the report data successfully.

shu...@mobistreak.com

unread,
Dec 21, 2016, 3:29:06 AM12/21/16
to AdWords API Forum
Hi,

Would you be able to tell me why a simple program works fine when called from nodejs using python-shell but not my adwords code?

Joyce Lava

unread,
Dec 21, 2016, 3:49:30 AM12/21/16
to AdWords API Forum
Hi,

Could you please confirm if you are using our Python client library? Also, since this is a new question, could you please open a new thread for us to properly track the concerns?

shu...@mobistreak.com

unread,
Dec 21, 2016, 4:14:23 AM12/21/16
to AdWords API Forum
Hi,

Yes i am using Python library and i posted it as a new question here
Reply all
Reply to author
Forward
0 new messages