public void GenerateHistoricalMetrics(GoogleAdsClient client, long 
customerId, long keywordPlanId)
        {
            KeywordPlanServiceClient kpServiceClient = 
client.GetService(Services.V10.KeywordPlanService);
            try
            {
                GenerateHistoricalMetricsRequest 
generateHistoricalMetricsRequest = new GenerateHistoricalMetricsRequest
                {
                    KeywordPlanAsKeywordPlanName = 
KeywordPlanName.FromCustomerKeywordPlan(customerId.ToString(), 
keywordPlanId.ToString()),
                    AggregateMetrics = new KeywordPlanAggregateMetrics(),
                    HistoricalMetricsOptions = new 
HistoricalMetricsOptions(),
                };

                
generateHistoricalMetricsRequest.AggregateMetrics.AggregateMetricTypes.Add(KeywordPlanAggregateMetricType.Device);

                GenerateHistoricalMetricsResponse response = 
kpServiceClient.GenerateHistoricalMetrics(generateHistoricalMetricsRequest);

            }
            catch (GoogleAdsException e)
            {
                throw;
            }
        }


Why is AggregateMetricResults empty in my returned results, while Metrics 
has data? Is it true that my AggregateMetrics.AggregateMetricTypes are not 
set? How can I do this?

thanks

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/6ee15b95-3d0c-4bdb-a1f6-4b66d221e8f6n%40googlegroups.com.

Reply via email to