We help IT Professionals succeed at work.

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

Medium Priority
876 Views
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:
 $email = 'INSERT_LOGIN_EMAIL_HERE';
 $password = 'INSERT_PASSWORD_HERE';
 $client_email = 'INSERT_CLIENT_LOGIN_EMAIL_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
<?php
 // 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
 //
 // http://www.apache.org/licenses/LICENSE-2.0
 //
 // 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. */
 
 require_once('soapclientfactory.php');
 
 # Provide AdWords login information.
 $email = 'INSERT_LOGIN_EMAIL_HERE';
 $password = 'INSERT_PASSWORD_HERE';
 $client_email = 'INSERT_CLIENT_LOGIN_EMAIL_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
 # "sandbox.google.com" with "adwords.google.com".
 $namespace = 'https://sandbox.google.com/api/adwords/v12';
 $keyword_tool_service = SoapClientFactory::GetClient(
 $namespace . '/KeywordToolService?wsdl', 'wsdl');
 $keyword_tool_service->setHeaders($headers);
 $debug = 0;
 
 # Create seed keyword structure.
 $seed_keyword =
 '<negative>false</negative>' .
 '<text>mars cruise</text>' .
 '<type>Broad</type>';
 $use_synonyms = '<useSynonyms>true</useSynonyms>';
 
 # Get keyword variations.
 $request_xml =
 '<getKeywordVariations>' .
 '<seedKeywords>' . $seed_keyword . '</seedKeywords>' .
 $use_synonyms .
 '<languages>en</languages>' .
 '<countries>US</countries>' .
 '</getKeywordVariations>';
 $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";
 exit(0);
 }
 ?>

Open in new window

Comment
Watch Question

Commented:
Please visit: http://code.google.com/apis/adwords/docs/developer/index.html#adwords_api_intro_signing

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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.