What is the client_email, developer_token, useragent and application_token in adword api?

Posted on 2009-02-17
Last Modified: 2013-11-10
Hi, I try learn more about google API and I get the code you see in code snippet for I made a test and closer to the tool.
I have doubts about this part of the code:
 $password = 'INSERT_PASSWORD_HERE';
 $useragent = 'INSERT_COMPANY_NAME: AdWords API PHP Sample Code';
 $developer_token = 'INSERT_DEVELOPER_TOKEN_HERE';
 $application_token = 'INSERT_APPLICATION_TOKEN_HERE';

I have account in google adwords. So email and password can be the same I use for login in my adwords account, right?
The client_email is the same of my e-mail?
How I get useragent, developer_token and application_token.

Regards, JC

 // Copyright 2008, Google Inc. All Rights Reserved.


 // Licensed under the Apache License, Version 2.0 (the "License");

 // you may not use this file except in compliance with the License.

 // You may obtain a copy of the License at




 // Unless required by applicable law or agreed to in writing, software

 // distributed under the License is distributed on an "AS IS" BASIS,

 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

 // See the License for the specific language governing permissions and

 // limitations under the License.


 /** This code sample retrieves variations for a seed keyword. */




 # Provide AdWords login information.


 $password = 'INSERT_PASSWORD_HERE';


 $useragent = 'INSERT_COMPANY_NAME: AdWords API PHP Sample Code';

 $developer_token = 'INSERT_DEVELOPER_TOKEN_HERE';

 $application_token = 'INSERT_APPLICATION_TOKEN_HERE';


 # Define SOAP headers.

 $headers =

 '<email>' . $email . '</email>'.

 '<password>' . $password . '</password>' .

 '<clientEmail>' . $client_email . '</clientEmail>' .

 '<useragent>' . $useragent . '</useragent>' .

 '<developerToken>' . $developer_token . '</developerToken>' .

 '<applicationToken>' . $application_token . '</applicationToken>';


 # Set up service connection. To view XML request/response, change value of

 # $debug to 1. To send requests to production environment, replace

 # "" with "".

 $namespace = '';

 $keyword_tool_service = SoapClientFactory::GetClient(

 $namespace . '/KeywordToolService?wsdl', 'wsdl');


 $debug = 0;


 # Create seed keyword structure.

 $seed_keyword =

 '<negative>false</negative>' .

 '<text>mars cruise</text>' .


 $use_synonyms = '<useSynonyms>true</useSynonyms>';


 # Get keyword variations.

 $request_xml =

 '<getKeywordVariations>' .

 '<seedKeywords>' . $seed_keyword . '</seedKeywords>' .

 $use_synonyms .

 '<languages>en</languages>' .

 '<countries>US</countries>' .


 $variation_lists =

 $keyword_tool_service->call('getKeywordVariations', $request_xml);

 $variation_lists = $variation_lists['getKeywordVariationsReturn'];

 if ($debug) show_xml($keyword_tool_service);

 if ($keyword_tool_service->fault) show_fault($keyword_tool_service);


 # Display keyword variations.

 $to_consider = $variation_lists['additionalToConsider'];

 echo 'List of additional keywords to consider has ' . count($to_consider) .

 ' variation(s).' . "\n";


 $more_specific = $variation_lists['moreSpecific'];

 echo 'List of popular queries with given seed has ' . count($more_specific) .

 ' variation(s).' . "\n";


 function show_xml($service) {

 echo $service->request;

 echo $service->response;

 echo "\n";



 function show_fault($service) {

 echo "\n";

 echo 'Fault: ' . $service->fault . "\n";

 echo 'Code: ' . $service->faultcode . "\n";

 echo 'String: ' . $service->faultstring . "\n";

 echo 'Detail: ' . $service->faultdetail . "\n";




Open in new window

Question by:Pedro Chagas
    1 Comment
    LVL 9

    Accepted Solution

    Please visit:

    Then sign up for an API Developer account. After you do this, you will know exactly what to enter in each of the required login fields. This is different than your AdWords account information, and it will supply you with the needed information (eg. developer tokens).

    Good luck

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Read about how to choose the best possible content marketing agency to suit your needs. Content marketing has become an integral part of running a successful tech business, so it is wise to be informed.
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now