Hi, I use PHP API v201603. If I make request via *TargetingIdeaService* It 
returns wrong values for *SEARCH_VOLUME*, *AVERAGE_CPC* and *SEARCH_VOLUME,*
 *AVERAGE_CPC* in *TARGET_MONTHLY_SEARCHES* only *KEYWORD_TEXT* is correct.

In the picture from *Google AdWords -> Tools -> Keyword planner* You can 
see 4 keywords *"Test, auto, autoškola, fasgasg"* 

   - test - Search volume: 12 100, CPC: 9,95 Kč
   - auto - Search volume: 27 100, CPC: 9,29 Kč
   - autoškola - Search volume: 4 400, CPC: 6,39 Kč
   - fasgasg - Search volume: -, CPC: -

<https://lh3.googleusercontent.com/-wEbP74bxZDY/VxD-znXs0jI/AAAAAAAABxA/91iJn1WmAZElalCjCY-X8AEKKSkgUJD3gCLcB/s1600/Screen%2BShot%2B2016-04-15%2Bat%2B12.34.39.png>


In this second picture you can see dumped results returned from PHP API in 
my APP.

<https://lh3.googleusercontent.com/-NX5qkUBzZY8/VxEBrF7BcxI/AAAAAAAABxM/HmwN2Zj8gxw37LYEBojAik6TM-vSQdXBQCLcB/s1600/Screen%2BShot%2B2016-04-15%2Bat%2B12.41.37.png>

My problem is in different values from AdWords and my APP.

   - KW: *fasgasg*
      - CPC from AdWords: - (0, NULL, or something like that)
      - CPC from my APP: *-*4674422423092159488 (and if it is converted 
      from microAmount it will be *-*4674422423092159488000000)
      - Search value from AdWords: - (0, NULL, or something like that)
      - Search value from my APP: 767580017206867942
   - KW: *auto*
      - CPC from AdW: 9,29 Kč
      - CPC from my APP: 8468354352673602560 (convert from microAmount 
      - 8468354352673,602560)
      - Search volume from Adw: 27 100
      - Search volume from my APP: 492248457842398316
   - And more...

*There is my PHP source code:*
<?php


require_once '../vendor/autoload.php';

use Tracy\Debugger; Debugger::enable();


$queries = ['Test', 'Autoškola', 'Auto', 'fasgasg'];

$user = new AdWordsUser();
$user->SetClientCustomerId('224-971-6211');
$user->LogDefaults();


$targetingIdeaService = $user->GetService('TargetingIdeaService', 'v201603');


/*foreach ($queries as $key => $value) {
    $queries[$key] = new Keyword($value, 'BROAD');
}*/

$selector = new TargetingIdeaSelector();

$selector->requestType = 'STATS';
$selector->ideaType = 'KEYWORD';
$selector->requestedAttributeTypes = ['KEYWORD_TEXT', 'SEARCH_VOLUME', 
'AVERAGE_CPC', 'TARGETED_MONTHLY_SEARCHES'];

$relatedToQuerySearchParameter = new RelatedToQuerySearchParameter();
$relatedToQuerySearchParameter->queries = $queries;
$selector->searchParameters[] = $relatedToQuerySearchParameter;

/*$english = new Language();
$english->id = 1021; // CZ

$languageParameter = new LanguageSearchParameter();
$languageParameter->languages[] = $english;
$selector->searchParameters[] = $languageParameter;*/

$location = new Location();
$location->id = 2203; // ČR

$locationParameter = new LocationSearchParameter();
$locationParameter->locations[] = $location;
$selector->searchParameters[] = $locationParameter;


$networkSetting = new NetworkSetting();
$networkSetting->targetGoogleSearch = true;
$networkSetting->targetSearchNetwork = false;
$networkSetting->targetContentNetwork = false;
$networkSetting->targetPartnerSearchNetwork = false;

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

$selector->paging = new Paging(0, sizeof($queries));

$keywordStats = [];

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

    if (isset($page->entries))
    {
        foreach ($page->entries as $targetingIdea)
        {
            $data = MapUtils::GetMap($targetingIdea->data);

            $keywordStats[] = [
                'keyword' => $data['KEYWORD_TEXT']->value,
                'search_volume' => $data['SEARCH_VOLUME']->value,
                'average_cpc' => $data['AVERAGE_CPC']->value->microAmount,
                'target_monthly_searches' => 
$data['TARGETED_MONTHLY_SEARCHES']->value
            ];

            Debugger::barDump($data['KEYWORD_TEXT']);
            Debugger::barDump($data['SEARCH_VOLUME']);
            Debugger::barDump($data['AVERAGE_CPC']);
            Debugger::barDump($data['TARGETED_MONTHLY_SEARCHES']);
            Debugger::barDump(NULL);

        }
    } else {
        print "No keywords ideas were found.\n";
    }

    $selector->paging->startIndex += sizeof($queries);

} while ($page->totalNumEntries > $selector->paging->startIndex);


?>

<?php foreach ($keywordStats as $kw) { ?>

    <h1>KW: <?= $kw['keyword'] ?></h1>
    <p>Search volume: <?= $kw['search_volume']?></p>
    <p>CPC: <?= $kw['average_cpc'] ?></p>

<?php } ?>


I will be very thankful if anybody can help me.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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
--- 
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 [email protected].
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/60771776-dd10-4ef7-b2a3-5f37d993b5e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to