Hi all! 
(As usual) I'm working on migrating AdWords API to Ads API. 
The use case is the following: 

Feed an amount of keywords (paginating them by keyword plans a 10k) to 
generateHistoricalMetrics($keywordPlanResource) and collect the results.

To achieve this I followed rather closely the instructions at 
https://developers.google.com/google-ads/api/docs/keyword-planning/generate-historical-metrics?hl=en
and especially 
https://developers.google.com/google-ads/api/docs/keyword-planning/generate-historical-metrics?hl=en#mapping_to_the_ui
using KeywordPlanAdGroupKeywords (with a single ad group)
and avoiding to pass a specific date range for now, relying on the default 
value. 

I had to apply some filters on my keywords because of 
KEYWORD_HAS_INVALID_CHARS and KEYWORD_TEXT_TOO_LONG, but all the errors 
which I'm aware of are gone now. 

Now, I found out, that the KeywordPlanHistoricalMetrics object does *not* 
contain any keyword id (of the form 
customers/*/keywordPlanAdGroupKeywords/*) So, I have to rely on the correct 
ordering. This is ok as it seems, that the original ordering of keywords is 
preserved within the results. 
https://developers.google.com/protocol-buffers/docs/encoding#optional

But still I have the problem, that 

count($keywordPlanServiceClient->generateHistoricalMetrics($keywordPlanResource)->getMetrics())
 
< count($passedKeywords)

where each of $passedKeywords where passed to 

new KeywordPlanAdGroupKeyword([
'text' => $passedKeyword,
'match_type' => KeywordMatchType::EXACT
'keyword_plan_ad_group' => $planAdGroupResource
]);

So I have two questions here: 

1. Why getMetrics() does not yield the same amount of results as the amount 
of passed keywords?

2. I'm struggling with debugging at this moment: Say, I want to know which 
keywords are let out. Either for providing more information at this place 
or just to skip them, and let my customer know, that these particular 
keywords were not queried. How to do this, when although I have a 
keyword-id for every passed keyword I cannot match the returned metrics to 
them, because the KeywordPlanHistoricalMetrics object does not contain any 
keyword id. 


Cheers and thanks in advance 

Alex

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/00920dc3-b7e7-46dc-9006-9911311c41efn%40googlegroups.com.
  • ge... Alexander Orlov
    • ... Alexander Orlov
      • ... Alexander Orlov
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
          • ... Alexander Orlov
            • ... Alexander Orlov
              • ... 'Lasse Bonner' via Google Ads API and AdWords API Forum

Reply via email to