While I am successfully able to query any other AdWords service for
existing entities, I seem to have hit a wall retrieving entities from the
AdGroupExtensionSettingService (v201607). Here is my function.
public function _getAdGroupExtensionSettings(\AdGroupExtensionSettingService
$adGroupExtensionSettingService, $adgroup_id)
{
$adGroupExtensionSettings = array();
$selector = new \Selector();
$selector->fields = array('AdGroupId','ExtensionType','Extensions');
$selector->predicates[] = new \Predicate('AdGroupId', 'EQUALS', (string)
$adgroup_id);
$selector->predicates[] = new \Predicate('ExtensionType', 'EQUALS',
'PRICE');
// Create paging controls.
$selector->paging = new \Paging(0,
\AdWordsConstants::RECOMMENDED_PAGE_SIZE);
$i = 0;
do {
// Make the get request.
$page = $adGroupExtensionSettingService->get($selector);
// Get results.
if (isset($page->entries)) {
foreach($page->entries as $setting) {
$adGroupExtensionSettings[] = $setting;
}
}
// Advance the paging index.
$selector->paging->startIndex +=
\AdWordsConstants::RECOMMENDED_PAGE_SIZE;
} while ($page->totalNumEntries > $selector->paging->startIndex);
return $adGroupExtensionSettings;
}
Judging from the documentation, it should be straightforward to query this
service the same way as any other:
https://developers.google.com/adwords/api/docs/reference/v201607/AdGroupExtensionSettingService#get
I have triple checked to ensure the adgroup_id I am passing corresponds
with an adgroup in this account which does have price extensions. I have
also tried, for debugging purposes, to remove the AdGroupId predicate
and/or the ExtensionType predicate, all to no avail.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/c17037cf-ff03-417c-9060-45a6510932fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.