Incorrect search volume

2017-06-27 Thread vaibhav Yadav

get($session, TargetingIdeaService::class);

$selector = new TargetingIdeaSelector();
$selector->setRequestType(RequestType::STATS);
$selector->setIdeaType(IdeaType::KEYWORD);
$selector->setRequestedAttributeTypes([
AttributeType::KEYWORD_TEXT,
AttributeType::SEARCH_VOLUME
]);

$searchParameters = [];
   
$keyword = 'Yoga';

$relatedToQuerySearchParameter = new RelatedToQuerySearchParameter();
$relatedToQuerySearchParameter->setQueries([$keyword]);
$searchParameters[] = $relatedToQuerySearchParameter;

  
$languageParameter = new LanguageSearchParameter();
$english = new Language();
$english->setId(1000);
$languageParameter->setLanguages([$english]);
$searchParameters[] = $languageParameter;
  
  
$locationData = new LocationSearchParameter();
$india = new Location();
$india->setId(2356);
$locationData->setLocations([$india]);
$searchParameters[] = $locationData;
  
  


$networkSetting = new NetworkSetting();
$networkSetting->setTargetGoogleSearch(true);
$networkSetting->setTargetSearchNetwork(false);
$networkSetting->setTargetContentNetwork(false);
$networkSetting->setTargetPartnerSearchNetwork(false);

$networkSearchParameter = new NetworkSearchParameter();
$networkSearchParameter->setNetworkSetting($networkSetting);
$searchParameters[] = $networkSearchParameter;

$selector->setSearchParameters($searchParameters);
$selector->setPaging(new Paging(0, self::PAGE_LIMIT));

$totalNumEntries = 0;
do {
  
  $page = $targetingIdeaService->get($selector);


  if ($page->getEntries() !== null) {
  
$totalNumEntries = $page->getTotalNumEntries();
foreach ($page->getEntries() as $targetingIdea) {
  $data = MapEntries::toAssociativeArray($targetingIdea->getData());
  $keyword = $data[AttributeType::KEYWORD_TEXT]->getValue();

  $searchVolume =
  ($data[AttributeType::SEARCH_VOLUME]->getValue() !== null)
  ? $data[AttributeType::SEARCH_VOLUME]->getValue() : 0;
 
  printf(
  "Keyword idea with text '%s',  and average "
  . "monthly search volume %d was found.\n",
  $keyword,
  $searchVolume
  );
}
  
  }

  $selector->getPaging()->setStartIndex(
  $selector->getPaging()->getStartIndex() + self::PAGE_LIMIT);
} while ($selector->getPaging()->getStartIndex() < $totalNumEntries);

printf("Number of results found: %d\n", $totalNumEntries);
  }


  public static function main() {
  

$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile()
->build();


$session = (new AdWordsSessionBuilder())
->fromFile()
->withOAuth2Credential($oAuth2Credential)
->build();
self::runExample(new AdWordsServices(), $session);
  }
}

GetKeywordIdeas::main();



I am getting ridculous search volumes for even keywords such as 
'svvqwegwqqg' which should not have a search volume in millions.
If i use TARGETED_MONTHLY_SEARCHES, the answer is always 1. Please help

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ffd6a2c8-0fab-4756-a654-4e84b7d3f396%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Targeting idea selector giving incorrect search volume

2017-06-27 Thread vaibhav Yadav
I am getting incorrect search volumes. Even using keywords such as 
'ewrqerqdas' which should absolutely give 0 search volume, it is showing in 
millions. Please guide. 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/bcc8be0a-d85b-459b-87d2-1758a1d4acd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<>


Incorrect CPC. Money attribute

2017-07-10 Thread vaibhav Yadav
I am using TargetingIdeaService to find data for keywords such as bid 
value, search volume, cpc, etc.
I am getting correct search volume and ideas but i am getting incorrect cpc.
The output data for the keyword 'car' looks as follows :


cars for sale : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 86852622 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
used cars : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 121778649 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
new cars : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 40170 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
car sales : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 16435437 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
used car sales : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 92384020 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
used cars for sale : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 139973717 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
new car prices : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 122150944 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
car search : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 115225122 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
used cars for sale near me : Google\AdsApi\AdWords\v201702\cm\Money Object 
( [microAmount:protected] => 176359912 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
new cars for sale : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 185963380 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
compare cars : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 22170602 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
used car search : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 130319306 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
find a car : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 93113491 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
cars for sale near me : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 104996541 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
vehicles for sale : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 91463897 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
car websites : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 90903063 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 
cool cars : Google\AdsApi\AdWords\v201702\cm\Money Object ( 
[microAmount:protected] => 165872325 [ComparableValueType:protected] => 
[ComparableValue.Type] => Money ) 

I am not getting the value is dollars and i am not able to understand this 
string. Please help. Thankyou:)

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/69b2f71e-83bd-4f68-a9c7-473b462865df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.