get a list of Extensions

53 views
Skip to first unread message

maurice....@griffithuni.edu.au

unread,
Jul 28, 2016, 7:53:11 PM7/28/16
to AdWords API Forum
Hi Adwords API support,



How would I retrieve a list of extensions used for my account ? Thanks in advance.

maurice....@griffithuni.edu.au

unread,
Jul 29, 2016, 12:17:34 AM7/29/16
to AdWords API Forum
Have tried using this service, but i get the following error: [Error] There is a problem getting the account activities[SelectorError.MISSING_FIELDS @ selector]

Please have a look and would really appreciate some assistance.


Script:
       
                    $campaignExtensionSettingService = $this->user->GetService('CampaignExtensionSettingService', $this->adwords_version);
                        $dateTimeRange = new DateTimeRange();
                        $dateTimeRange->min = date('Ymd his', $a).' '.date_default_timezone_get();
                        $dateTimeRange->max = date('Ymd his', strtotime("+1 days", $a)).' '.date_default_timezone_get();
                        
                        
                        
                        $selector2 = new Selector();
                        $selector2->dateTimeRange = $dateTimeRange;
                       // $selector2->campaignIds = $campaignIds;
                        //$selector2->fields = array('feedId', 'feedType');
                        $adextensions = $campaignExtensionSettingService->get($selector2);
                             //echo  count($adextensions->entries);
                        foreach ($adextensions->extensions as $extensionFeedItem) {
                            echo "test";
                        } 

maurice....@griffithuni.edu.au

unread,
Jul 29, 2016, 1:09:15 AM7/29/16
to AdWords API Forum
You need to look at the fields list. Would really appreciate adwords support team help next time.

Peter Oliquino

unread,
Jul 29, 2016, 1:32:59 AM7/29/16
to AdWords API Forum
Hi Maurice,

Apologies for the delayed response. The error you are encountering is due to the list of selected fields being null or empty. You might want to uncomment this line " //$selector2->fields = array('feedId', 'feedType');". Additionally, you may refer to this link for the fields supported by the Selector for CampaignExtensionSettingService.get. Furthermore, to get the list of sitelinks only, you may use the SITELINK value for extensionType as a predicate.

Thanks and regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages