Create Ads in behalf of a customer

96 views
Skip to first unread message

Dom

unread,
Nov 23, 2021, 11:52:38 AM11/23/21
to AdWords API and Google Ads API Forum
Hi,
I am pretty new to the google api universe and a bit lost tbh.

I want to realize the following:

- Provide a login button inside my application
- users authenticate with my google application using oauth2
- provide a list of adaccounts accessible by the user
- Create/update/fetch  adCampaigns on behalf of the selected ad account

Question1:
Is this scenario even possible? What scope do I need to require when authenticating?

Question2:
Which php library is the way to go? I've found 

Question3:
Seems like I need a developertoken and a customerID.
How do I get that using the accessToken?

Google Ads API Forum Advisor

unread,
Nov 24, 2021, 2:18:39 AM11/24/21
to d.pa...@gmail.com, adwor...@googlegroups.com
Hi Dominik,

Thank you for posting your concern. Allow me to provide support here.

Please see my response to each question:

Is this scenario even possible? What scope do I need to require when authenticating?
-For 'Provide a login button inside my application', could you provide more details on the login specification that you provided? Which account should the customer login to?

-As for "Users authenticate with my google application using oauth2", your application should follow the authentication discussed on documents below:
https://developers.google.com/google-ads/api/docs/oauth/cloud-project
https://developers.google.com/google-ads/api/docs/oauth/client-library

-To get the list of Google Ads accounts accessible by users, then you may implement this on your application.

-To create campaigns, you may follow this document while this is the sample code that you can try to update campaigns. To fetch data of the campaign, then you can use the campaign report type.


Question2:
Which php library is the way to go? I've found 
- googleads/google-ads-php
- googleads/googleads-php-lib


-It appears that provided links are third-party client libraries, with this, I would suggest to use our official client library for PHP and you can see it on this link.


Question3:
Seems like I need a developertoken and a customerID.
How do I get that using the accessToken?

-I am afraid that this is not possible using an access token. To get the developer token, you will need to navigate to the TOOLS & SETTINGS > SETUP > API Center of your MCC account where it is generated. To get the Google Ads accounts including the customer ID accessible by users, then you can implement this as well.

Regards,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2RveGW:ref

Dom

unread,
Nov 28, 2021, 11:53:00 AM11/28/21
to AdWords API and Google Ads API Forum
Hi, 
thank you very much for the feedback.

> -I am afraid that this is not possible using an access token. To get the developer token, you will need to navigate to the TOOLS & SETTINGS > SETUP > API Center of your MCC account where it is generated. To get the Google Ads accounts including the customer ID accessible by users, then you can implement this as well.

Ok. Does that mean it is not possible to provide our customers an oauth login and create ads afterwards because I can't resolve the customerId necessary to access his ad account?
Can you point out more clearly if my usecase is realizable or not?

Best regards

Google Ads API Forum Advisor

unread,
Nov 29, 2021, 7:02:48 PM11/29/21
to d.pa...@gmail.com, adwor...@googlegroups.com
Hi Dom,

To clarify, an access token is generated using your OAuth credentials. The developer token nor the customer ID is obtained using the access token. Please see the recommended documentation below:
Regards,
Matt
Google Ads API Team



Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Google Logo
Matt
Google Ads API Team
 


Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Google Logo
Matt
Google Ads API Team
 


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