Hi All,
i have got developer_token,client_email.
i use the demo of get_keyword_variations.php .
But it returns "List of additional keywords to consider has 0
variation(s). List of popular queries with given seed has 0 variation(s)."
it shows maybe the method of getKeywordVariations not work rightly.
i use the code of get_keyword_variations.php below:
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/v13';
$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>travel</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>GB</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);
}
?>
Plz help me
Thanks,
ASD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---