private const LOC_IDS = array(
array(21132,21133,21135,21136,21137,21138,21139,21140,21141),
array(21142,21143,21144,21145,21146,21147,21148,21149,21150),
array(21151,21152,21153,21154,21155,21156,21157,21158,21159),
array(21160,21161,21162,21163,21164,21165,21166,21167,21168),
array(21169,21170,21171,21172,21173,21174,21175,21176,21177),
array(21178,21179,21180,21182,21183,21184)
);
I run
function with above location ids, it shows a little different with google keywordideas.
for example when I enter the keyword("rare books"), google shows
(avg month search: 6,600,
High bid
—
$0.41)
but my app shows
avg month search :7390, high bid: $6.24(micro value is 6248351)
I got the result after tried to sum each it's value from 6 times searching.
foreach ($response->iterateAllElements() as $result) {
$avg = (is_null($result->getKeywordIdeaMetrics()) ? 0 : $result->getKeywordIdeaMetrics()->getAvgMonthlySearches());
$bid = (is_null($result->getKeywordIdeaMetrics()) ? 0 : $result->getKeywordIdeaMetrics()->getHighTopOfPageBidMicros());
$comp = (is_null($result->getKeywordIdeaMetrics()) ? 0 : $result->getKeywordIdeaMetrics()->getCompetition());
if ($comp > 3 && $bid > 0) {
for ($j=0; $j<$cnt; $j++) {
if ($res[$j]["keyword"] == $result->getText()) {
$flag = true;
break;
}
}
if ($flag) {
$res[$j]["avgmonth"] += $avg;
$res[$j]["highbid"] += $bid;
$flag = false;
} else {
...
}
}
}
what is my issue?
Thanks