Help me to retrieve keyword metircs using adGroupCriterionService

18 views
Skip to first unread message

teletextho...@gmail.com

unread,
Mar 16, 2017, 9:28:18 AM3/16/17
to AdWords API Forum
Hi Mates

Code PHP

I am using Adwords API version(V201605), I am able to to retrieve keyword name and id. But how to retrieve keyword metrics.
I request some to help me to retrieve  keyword metrics using PHP. 

Please help me on this as it is bit urgent as I will be grateful to you.

I am using below code sinppet




                        $adGroupCriterionService =
$user->GetService('AdGroupCriterionService','v201605');

// Create selector.
$selector = new \Selector();
// $selector->fields = array('KeywordText', 'KeywordMatchType', 'Id', 'Impressions', 'Clicks', 'Cost', 'AveragePosition');
$selector->fields = array('KeywordText', 'KeywordMatchType', 'Id');
$selector->ordering[] = new \OrderBy('KeywordText', 'ASCENDING');

// Create predicates.
$selector->predicates[] = new \Predicate('AdGroupId', 'IN', array($adGroupId));
$selector->predicates[] =
new \Predicate('CriteriaType', 'IN', array('KEYWORD'));

// Create paging controls.
  // $selector->paging = new \Paging(0, \AdWordsConstants::RECOMMENDED_PAGE_SIZE);

$ret = array();
 
// Make the get request.
$page = $adGroupCriterionService->get($selector);


Thanks
Tesetext

Vishal Vinayak (Adwords API Team)

unread,
Mar 16, 2017, 1:46:17 PM3/16/17
to AdWords API Forum
Hi,

Metrics related information is not available via AdWords API services. Please use AdWords API reports to download metrics related to keywords, ad groups, campaigns etc. In your case, you can use Keyword Performance Report to download keyword performance metrics. Please refer to these examples available in our PHP client library to download a report. More information is available in our Reporting Guide.

Regards,
Vishal, AdWords API Team
Reply all
Reply to author
Forward
0 new messages