API for video campaign data

106 views
Skip to first unread message

Ciro Monteiro

unread,
Jul 28, 2020, 7:38:21 PM7/28/20
to AdWords API and Google Ads API Forum
Hi, there. I'm developing a website where the user can connect to his YouTube channel, upload the video through my website to his channel (I've already coded this feature), then he can check for data of all video campaigns related to this video uploaded through my website (my current task is to do this 'retrieve'). He's not going to create ads nor campaigns in my website, he's going to do it by himself with the videos uploaded to his channel, so I guess he should probably connect with his account in charge of advertising so I can obtain the advertising data.
I'm sorry for asking something that may have been already answered before, but I've been having some problem testing some snippets and I'm not sure about which API exactly I should be using to connect to user account, since the documentation indicates four tools here: https://developers.google.com/adwords/api/docs/guides/start .
After describing my goals, I hope someone can tell me exactly which API I'll be using.
Thanks for your time reading this specific matter.

Ciro Monteiro

unread,
Jul 28, 2020, 8:49:22 PM7/28/20
to AdWords API and Google Ads API Forum
Update: the backend of the application is Django (Python).

Google Ads API Forum Advisor Prod

unread,
Jul 29, 2020, 11:52:20 AM7/29/20
to ciro.m...@aevotech.com.br, adwor...@googlegroups.com

Hi Ciro,

Thank you for reaching out. You could follow this guide to set up the Adwords API and create necessary credentials and install the python client library to start making API calls. For retrieving data from the client’s account, you could query the Video Performance Report and it provides all sorts of metrics for the video campaigns.

Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q22Zs3J:ref

Ciro Monteiro

unread,
Jul 29, 2020, 10:43:50 PM7/29/20
to AdWords API and Google Ads API Forum
Hi, Xiaoming. Thanks for answering me.

When I use the class "AdWordsClient" (because I want to get data from user authenticated in my system), I need to pass the following arguments:
- developer_token (string), which I generated in my non-approved manager account;
- oauth2_client, which I generated assigning googleads.oauth2.GoogleRefreshTokenClient("OAuth 2.0 Client ID" of Google Ads API (web application), "OAuth 2.0 Client secret" of Google Ads API (web application), refresh_token obtained from social connection)
- client_customer_id, which I get manually from a test account that I know it's not a manager account because it doesn't show the settings for API that is shown in the manager account.

The AdWordsClient creation seems to work just fine.

I try to run my script and it stops in the line with "adwords_client.GetReportDownloader(version='v201809').DownloadReportWithAwql". I get the following error message:

googleads.errors.AdWordsReportBadRequestError: Type: ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH

I know from here this message is related to an idea of trying to get report from manager account (that I understand it shouldn't be possible, it makes sense to allow reports only from advertiser account), but the customer_id provided in AdWordsClient mentioned above belongs to a test (non-manager) account. One observation: the Google Account related to the token stored has both accounts (manager, with the developer token provided, and the test non-manager account). Is that a real problem? I create the test account here, then I use the Create a test manager account, even if I do it with another Google Account created only for this, I still get the error message above (after changing the user's tokens, of course). The 'developer token' is the same, from my corporate Google Account (ciro.m...@aevotech.com.br, which I use from the beginning of this process), I only change the test advertiser account, that I created for cirossmonte...@gmail.com, a Google Account created only for this purpose.

Google Ads API Forum Advisor Prod

unread,
Jul 30, 2020, 11:46:11 AM7/30/20
to ciro.m...@aevotech.com.br, adwor...@googlegroups.com

Hi Ciro,

Thank you for reaching out. The CUSTOMER_SERVING_TYPE_REPORT_MISMATCH error occurs when you are trying to make a report against a manager account. Certain types of reports could only be queried on the client customer account rather than the manager account. Please give it a try on the client account.



Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q22Zs3J:ref

Ciro Monteiro

unread,
Jul 30, 2020, 10:55:18 PM7/30/20
to AdWords API and Google Ads API Forum
Hi, Xiaoming.

I've already tried.

Quoting myself: "the customer_id provided in AdWordsClient mentioned above belongs to a test (non-manager) account.".

I hope there's another way to debug this issue.

Google Ads API Forum Advisor Prod

unread,
Jul 31, 2020, 1:53:08 PM7/31/20
to ciro.m...@aevotech.com.br, adwor...@googlegroups.com

Hi Ciro,

Thank you for reaching out. Could you please share the complete request and response logs along with the report definition and client customer id via the Reply privately to author option for me to further investigate?



Thanks and regards,
Xiaoming, Google Ads API Team

 

 



 

ref:_00D1U1174p._5004Q22Zs3J:ref
Reply all
Reply to author
Forward
0 new messages