How to use google Adword API
Please follow below steps to integrate google Adword API in PHP.
1. Create a MCC(AdWords manager account) account using below URL: https://www.google.com/adwords/manager-accounts/
2. After login into MCC account, visit https://console.developers.google.com/ and create new project(App) and make sure you select the 'installed application option'.
3. Note down app's Client ID and Client secret in auth.ini file.
4. Click on gearIcon > Account settings > AdWords API Centre and note down Developer token and userAgent and put this info in auth.ini file.
5. Now create a test Manager account with a email address. Note that this email address should not already be associated with an adwords account. Please use below URL to create a test Manager account: https://adwords.google.com/um/Welcome/Home?sf=mt#ta
6. Copy Customer ID from top right corner of test Manager account and use it as 'clientCustomerId' in auth.ini file.
7. Now login into MCC account and run GetRefreshToken.php file in another tab of same browser. It will display a URL. Copy this URL and login into test Manager account in different browser and run copied URL. It will ask to allow some permissions. Click 'Allow' button and it will display a code. This code is not your refresh token.Its is only an access token. Copy this code and paste it into GetRefreshToken.php file for the value of '$code' variable.
8. Now refresh the page where we run GetRefreshToken.php. This time it will give us refresh token. Copy this refresh token and use it inot auth.ini file.
9. Run examples/AdWords/v201509/Remarketing/AddAudience.php, it will upload a Audience list into our test manager account.
1. Create a MCC(AdWords manager account) account using below URL: https://www.google.com/adwords/manager-accounts/
2. After login into MCC account, visit https://console.developers.google.com/ and create new project(App) and make sure you select the 'installed application option'.
3. Note down app's Client ID and Client secret in auth.ini file.
4. Click on gearIcon > Account settings > AdWords API Centre and note down Developer token and userAgent and put this info in auth.ini file.
5. Now create a test Manager account with a email address. Note that this email address should not already be associated with an adwords account. Please use below URL to create a test Manager account: https://adwords.google.com/um/Welcome/Home?sf=mt#ta
6. Copy Customer ID from top right corner of test Manager account and use it as 'clientCustomerId' in auth.ini file.
7. Now login into MCC account and run GetRefreshToken.php file in another tab of same browser. It will display a URL. Copy this URL and login into test Manager account in different browser and run copied URL. It will ask to allow some permissions. Click 'Allow' button and it will display a code. This code is not your refresh token.Its is only an access token. Copy this code and paste it into GetRefreshToken.php file for the value of '$code' variable.
8. Now refresh the page where we run GetRefreshToken.php. This time it will give us refresh token. Copy this refresh token and use it inot auth.ini file.
9. Run examples/AdWords/v201509/Remarketing/AddAudience.php, it will upload a Audience list into our test manager account.
Comments
Post a Comment