I am trying to get all the "adwords" from the sandbox, what I see when I run
getRelatedKeywords.php is this:
Keyword idea with text 'red herring 3b3e7c68', match type 'EXACT', and
average monthly search volume '301000' and global search volume '301000'
and search volume '0' was found.
Array
Keyword idea with text 'web 13b5d34f', match type 'EXACT', and
average monthly search volume '301000' and global search volume '301000'
and search volume '0' was found.
Array
Keyword idea with text 'web 45bf01ce', match type 'EXACT', and
average monthly search volume '301000' and global search volume '301000'
and search volume '0' was found.
Array
i dont passes 'red herring' keyword and in my result i found
'red herring' keyword with some numer at the and of the keyword like
'red herring 3b3e7c68' what is that no?
and global and monthly searcch had also same volume.
and i also want to search with url that also not give me the real result
my code is like this:
$user = new AdWordsUser(null, $username, $password, $developerToken);
$user->SetDefaultServer("
https://adwords-sandbox.google.com/");
$user->LogAll();
$user->SetClientId(null);
try {
// Get the service, which loads the required classes.
$targetingIdeaService = $user->GetService('TargetingIdeaService', 'v201109');
// Create seed keyword.
$keyword = new Keyword();
$keyword->text = 'web';
$keyword->matchType = 'EXACT';
// Create selector.
$selector = new TargetingIdeaSelector();
$selector->requestType = 'IDEAS';
$selector->ideaType = 'KEYWORD';
$selector->EXTRACTED_FROM_WEBPAGE='
www.acmewebitech.com';
$selector->requestedAttributeTypes =
array('CRITERION', 'AVERAGE_TARGETED_MONTHLY_SEARCHES','GLOBAL_MONTHLY_SEARCHES');
// Create related to keyword search parameter.
$selector->searchParameters[] =
new RelatedToKeywordSearchParameter(array($keyword));
// Create keyword match type search parameter to ensure unique results.
$selector->searchParameters[] =
new KeywordMatchTypeSearchParameter(array('EXACT'));
// Set selector paging (required by this service).
$selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);
do {
// Make the get request.
$page = $targetingIdeaService->get($selector);
// Display results.
if (isset($page->entries)) {
foreach ($page->entries as $targetingIdea) {
echo $targetingIdea->data;
$data = MapUtils::GetMap($targetingIdea->data);
$keyword = $data['CRITERION']->value;
$averageMonthlySearches =
isset($data['AVERAGE_TARGETED_MONTHLY_SEARCHES']->value)
? $data['AVERAGE_TARGETED_MONTHLY_SEARCHES']->value : 0;
$globalMonthlySearch=
isset($data['GLOBAL_MONTHLY_SEARCHES']->value)
? $data['GLOBAL_MONTHLY_SEARCHES']->value : 0;
$volume_search=isset($data['SEARCH_VOLUME']->value)
? $data['SEARCH_VOLUME']->value : 0;
printf("<br/>Keyword idea with text '%s', match type '%s', and average "
. "monthly search volume '%s' and global search volume '%s' and search volume '%s' was found.\n", $keyword->text,
$keyword->matchType, $averageMonthlySearches,$globalMonthlySearch,$volume_search);
}
} else {
print "No keywords ideas were found.\n";
}
// Advance the paging index.
$selector->paging->startIndex += AdWordsConstants::RECOMMENDED_PAGE_SIZE;
} while ($page->totalNumEntries > $selector->paging->startIndex);
} catch (Exception $e) {}