how to integrated adwords api?

555 views
Skip to first unread message

Richest Soft

unread,
Jul 19, 2016, 11:15:54 AM7/19/16
to AdWords API Forum
We need to integrated adwords api?
How to get all campaigns and ads in php?

Vishal Vinayak (Adwords API Team)

unread,
Jul 19, 2016, 4:40:17 PM7/19/16
to AdWords API Forum
Hi Richest Soft,

To be able to use the API, you would first need to sign up for API access and then follow these steps to make your first API call. This would involve generation of a developer token and OAuth credentials, both of which are needed to access the API, and setting up your local environment. Once your environment is set up, the GetCampaigns code sample and the GetTextAds code sample can help you accomplish the respective tasks. You can refer to more such examples in our PHP client library.

Hope this helps. Please feel free to revert in case you have further concerns.

Regards,
Vishal, AdWords API Team

Richest Soft

unread,
Jul 20, 2016, 12:59:19 AM7/20/16
to AdWords API Forum
we have get already developer token. also download "Adword PHP client library."
But we have not understand, how to implement this on our local environment.
Please elaborate this. 


Also get the Client ID,Client secret and omanager id, access token or refresh token.

Thanks

Vishal Vinayak (Adwords API Team)

unread,
Jul 20, 2016, 11:15:07 AM7/20/16
to AdWords API Forum
Hi Richest Soft,

You can find the instructions to install the PHP client library under the section Getting started on this page.

Richest Soft

unread,
Jul 21, 2016, 2:22:47 AM7/21/16
to AdWords API Forum
which file we use from library?

Nikhil Agarwal

unread,
Jul 21, 2016, 3:07:24 PM7/21/16
to AdWords API Forum
Hi Richest,

If you are using googleads-php-lib, please follow below steps to integrate this API at xampp server:

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/CampaignManagement/GetCampaignsByLabel.php, it will list campaigns.


Vishal Vinayak (Adwords API Team)

unread,
Jul 21, 2016, 3:49:49 PM7/21/16
to AdWords API Forum
Thanks for the elaborate instructions, Nikhil.

Hi,

You can refer to various examples in the PHP client library. For examples for adding a new campaign you can refer to the AddCampaigns example. Similarly to add new keywords you can see the AddKeywords example. Please let me know if you have further questions.

Richest Soft

unread,
Jul 22, 2016, 1:05:33 AM7/22/16
to AdWords API Forum
Hi Nikhil,
 
          Thanks for the instructions
  
I have some problem
1)I have seen blank output this file 'GetCampaignsByLabel.php". what's the problem?

Nikhil Agarwal

unread,
Jul 22, 2016, 5:55:06 AM7/22/16
to AdWords API Forum
Hi Richest,

Please remove below line from GetCampaignsByLabel.php page and try again. Hope it will work for you.

if (__FILE__ != realpath($_SERVER['PHP_SELF'])) {
  return;
}

Thanks

Vishal Vinayak (Adwords API Team)

unread,
Jul 22, 2016, 2:49:38 PM7/22/16
to AdWords API Forum
Hi,

Did Nikhil's suggestion help you solve the issue? If not, could you please provide the SOAP XML request and response logs for this API call? You can enable logging in your project by following the instruction under the section "Configuring logging" on this page.

Gary Liang

unread,
Dec 21, 2016, 1:06:26 AM12/21/16
to AdWords API Forum
Hi,

Currently, I am using a test manager account and create 2 test adwords clients. The test manager account asks filling billing information. i.e. credit card detail. I don't have a credit card. How should I approach this? (see attached pic)

Regards
Gary
test_account_billing.png

Vishal Vinayak (Adwords API Team)

unread,
Dec 21, 2016, 1:45:48 PM12/21/16
to AdWords API Forum
Hi Gary,

My team AdWords API related technical queries only. For questions related to AdWords product in general, please post your query on the AdWords Community Forum.

Ali Akbar Khan

unread,
Oct 30, 2018, 7:09:37 AM10/30/18
to AdWords API and Google Ads API Forum
Dear Nikhil Agarwal,

Hello.

I am a new one in this field. I want to integrate Google Ads API in my Website. Please tell me how i can integrate PHP Google Ads API in my Wordpress Web Site.
Your all Video tutorials are made on Old versions. Please update your Tutorials on latest version of APi with web site integration.

Your help is boost my efforts to done this project.

Waiting for your Reply.

Thanks   

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Oct 30, 2018, 1:13:03 PM10/30/18
to AdWords API and Google Ads API Forum
Hello,

Welcome to AdWords API!

To get started with the PHP client library, you could use the instructions in the README file. Here is the code samples in PHP client library. If you face any issues while setup, please let me know. Please note that our examples are meant to be run from the command line and not as a webpage. If you run them as a webpage, results may not be shown properly.

Thanks,
Sreelakshmi, AdWords API Team
Reply all
Reply to author
Forward
0 new messages