Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2009-02-17
Medium Priority
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
 // 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. */
 # 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
 # "sandbox.google.com" with "adwords.google.com".
 $namespace = 'https://sandbox.google.com/api/adwords/v12';
 $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

Accepted Solution

Mahdii7 earned 1500 total points
ID: 23665459
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

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
How does storytelling impact the web? What goes into a great story on the web? And how can it be used for marketing purposes? All of these questions will be answered.
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

580 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