How to Integrate Google Ads API in .Net
First, let’s take a look at how Google Ads work –
Google Ads in action:
You might see the Ads with the top row results in the Google search. What are they, why they differ from the other results?
Those are Google ads that a company paid for so that people will notice their business whenever they’re searching Google. And, the company only have to pay whenever someone clicks on the ad. This is known as cost-per-click advertising (CPC).
How to show your Ads on Google
Go to http://tinyurl.com/pevnb3j and create your own Google ads account. Then you can create your Ads with your preferred locations, keywords, etc. For help on creating managing your Google ads account go to http://tinyurl.com/qy6kuq7
Google ads API
The Google ads API allows applications to interact directly with the Google ads platform. You can build applications to more efficiently manage large or complex Google ads accounts. If you want to use Google ads API in your applications, first you will have to create an MCC account.
What is an MCC account?
MCC (My Client Center) Account
An MCC account -manager account- is a Google ads account that lets you easily view and manage multiple Google ads accounts –including other manager accounts– from a single location.
Learn more about MCC accounts here – http://tinyurl.com/q9f8tv8
The following information should be submitted for making Google ads API calls,
- Developer Token,
- Client Customer ID,
- oAuth2 Client ID,
- oAuth2 Client Secret,
- oAuth2 Refresh Token.
Where do you find all these?
After creating your MCC account successfully, you can see your Developer Token here http://tinyurl.com/pov4xwa
- Client Customer ID
Client Customer Id is your Google ads account ID. You can see this on the right-top position in the MCC or Google ads website.
- oAuth2 Client ID & oAuth2 Client Secret
Do you already have an account in Google developer console? If yes you can see this information here – http://tinyurl.com/qcunww3
New to Google developer console? learn how to use and manage it here – http://tinyurl.com/kl2vqxo
- oAuth2 Refresh Token
You can download the Adwords API libraries with examples in this link – http://tinyurl.com/nntrpyu.
After downloading go to the following path? “..\utilities\OAuthTokenGenerator\bin\Debug\”. There you can see a file named ‘OauthTokenGenerator.exe’. Run the file and you will get the following screen:
Submit Client ID and Client Secret you have handy then click OK, and it will show you the Refresh Token for your account.
Like to know more about Refresh Token? Go to – http://tinyurl.com/noqeloa
Following is a sample code for creating a new AdWords account in our MCC account,
Download “Google.Adwords.dll” and “Google.Ads.Common.dll” from http://tinyurl.com/nntrpyu
Find the .dll files inside – “..\examples\AdWords\CSharp\bin\Debug\”.
Please note: You can use the Developer Token only after your MCC account is verified by Google Team. This process is done by humans and it needs long time so. (sometimes it takes more than two months!)
Want to start coding right away?
MCC test Accounts comes for help.
MCC Test Account
MCC test accounts allow developers to execute AdWords API requests against the production environment for development and testing purposes. The MCC Test Account will not server the Ads on real Google search.
You must use a production (non-test) MCC account’s developer token to make AdWords API calls against a test account. You can use the production developer token against a test account even when the production developer token is pending approval.
You can create a new MCC Test Account here – http://tinyurl.com/nqlaymn
Download AdWords API libraries and sample codes from here – http://tinyurl.com/nntrpyu