Hello,
I need some help. For some reason my API account returns different
results for queries than everyone else's. My results are not accurate
and are different than other people using the same scripts as me. To
begin with, I started using the PHP client library example code to
start building queries. I thought I was successful until I realized
that my results did not match the google keyword tool and another
keyword tool I was using. Here is an example of a page that queries
for the term "birmingham dance studios" http://dreamspasm.com/adwords2.php
. There is no integer returned (0 assumed) even though I can see
through the Google (and other) keyword tools that there should be a
positive integer result. Here is the code I used for that page:
<?php
error_reporting(E_STRICT | E_ALL);
// You can set the include path to src directory or reference
// AdWordsUser.php directly via require_once.
// $path = '/path/to/aw_api_php_lib/src';
$path = dirname(__FILE__) . '/adwords-api/src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
require_once 'Google/Api/Ads/AdWords/Lib/AdWordsUser.php';
require_once 'Google/Api/Ads/Common/Util/MapUtils.php';
try {
// Get AdWordsUser from credentials in "../auth.ini"
// relative to the AdWordsUser.php file's directory.
$user = new AdWordsUser();
// Get the TargetingIdeaService.
$targetingIdeaService = $user-
>GetTargetingIdeaService('v200909');
// Set keyword to retrieve related keywords for.
$keyword = new Keyword('birmingham dance studios', 'EXACT');
// Set language.
$language = new LanguageTarget('en');
// Set country.
$country = new CountryTarget('US');
// Create selector to get related keywords.
$selector = new TargetingIdeaSelector();
$selector->requestType = 'STATS';
$selector->ideaType = 'KEYWORD';
$selector->searchParameters = array(
new RelatedToKeywordSearchParameter(array($keyword)),
new KeywordMatchTypeSearchParameter($keyword-
>matchType),
//new LanguageTargetSearchParameter(array($language)),
//new CountryTargetSearchParameter(array($country))
);
$selector->requestedAttributeTypes = array(
'KEYWORD',
'AVERAGE_TARGETED_MONTHLY_SEARCHES',
'GLOBAL_MONTHLY_SEARCHES'
);
// Increase paging for more results.
$selector->paging = new Paging(0, 6);
// Get targeting ideas.
$page = $targetingIdeaService->get($selector);
print_r($page);
// Display related keywords.
/*if (isset($page->entries)) {
foreach ($page->entries as $targetingIdea) {
$data = MapUtils::GetMap($targetingIdea->data);
$keyword = $data['KEYWORD']->value;
$averageMonthlySearches =
isset($data['AVERAGE_TARGETED_MONTHLY_SEARCHES']->value)
? $data['AVERAGE_TARGETED_MONTHLY_SEARCHES']->value : 0;
echo $keyword->text." | ";
echo $keyword->matchType." | ";
echo $averageMonthlySearches."<BR>\n";
}
} else {
print "No related keywords were found.\n";
}*/
} catch (Exception $e) {
print_r($e);
}
?>
So when I couldn't get that to work properly I decided to purchase a
copy of a script that I saw was working. I found this tool
http://www.femisez.com/adwordsv2009/index.php and purchased it. Notice
how if you search for birmingham dance studios you will get proper
results. I installed an exact copy of that script on my server but it
is returning the same results as the previously mentioned query I
built. Here is a link to the install on my server:
http://dreamspasm.com/members/keyword-tool/ .
I was speaking to the developer of that tool and we both believe that
something is wrong with my developer account. I have tried resetting
my developer token but it didn't help.
Please note: in my queries my main objective is to return accurate
results for exact type matches, omitting any keyword idea suggestions.
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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