Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
136 views
in Technique[技术] by (71.8m points)

c# - Google Ads API Integration

The Company I work with has many clients who uses Google Ads to do marketing for their websites. The company wants to use client's data for Analysis. I am given a project to integrate Google Ads API using C# to get all the data such as Campaigns etc from Google ads and move it to our system for each client. I am only given developer token and customerID for Clients. such as

  1. Customer ID for Client A
  2. Customer ID for Client B

I am bit lost when I went through the google ads API documentation. In the documentation, the OAuth2.0 needs creating in order to use client library which would generate client ID and Client Secret, Refresh token to integrate the API. My question is. Do I need to create OAuth2.0 for each client or do I need to ask my company to generate Client ID and secret in company's Manager Account or Client that uses Google ads would provide me these?

The following Link I found to create OAuth2.

https://developers.google.com/google-ads/api/docs/oauth/cloud-project

This is what I believe would require in C# enter image description here Content can be found at https://developers.google.com/adwords/api/docs/guides/first-api-call#.net_1

Would highly appreciate if any one can help me what actually I need to configure google ads using C#

question from:https://stackoverflow.com/questions/65829692/google-ads-api-integration

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If your company manager account is a manager for the relevant client accounts, you would just need to authenticate as the manager account using your developer token, client id and secret. This gives access to the Ads data for all clients linked under the manager account.

E.g. calling Google Ads API CustomerService > ListAccessibleCustomers returns a list of customers accessible to the authenticated client.

Further to comments where you say you will be creating a console app:

The link in your question says use a desktop application if:

You're managing all of your Google Ads accounts using a single top level manager account. You're a first-time user, or want to get started quickly with the simplest setup. Your app will only authenticate Google users from one machine.

So using a manager account which links the required client accounts would be required in this case. See OAuth desktop application flow.

If you used a web application, the clients could log in and your app could read and store their refresh token in a database to make future calls to the api for their account.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...