How to get the Extensions that don't belong to a Campaign or an AdGroup.

62 views
Skip to first unread message

SeriousJ

unread,
Apr 12, 2016, 10:58:56 AM4/12/16
to AdWords API Forum
I use the PHP client library with version v201603 of the API.
 
I am trying to get the Callout Extensions that don't belong to a Campaign or an AdGroup.

If an Extension belongs to a Campaign or an Adgroup, I can get it using the 'CampaignExtensionSettingService' or ''AdGroupExtensionSettingService' parameter in the GetService method.

Here is an example below that works fine:

    $campaignExtensionSettingService = $user->GetService('CustomerExtensionSettingService', ADWORDS_VERSION);
    $selector = new Selector();
    $selector->fields = array("ExtensionType", "Extensions");
    $selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);
    $campaignExtensionSettingService->get($selector);

However, I can't access Extensions that are not part of a Campaign or an AdGroup. Parameter 'CustomerExtensionSettingService' returns an empty result.

Any idea?

Yin Niu

unread,
Apr 12, 2016, 11:10:46 AM4/12/16
to AdWords API Forum
Hi, 

After you have created CalloutFeedItem, you need to set it to one of the ExtensionSettingsServices(CampaignExtensionSettingsService, AdGroupExtensionSettingsService, CustomerExtensionSettingsService). You can retrieve the calloutFeedItem using the FeedItemService

Thanks,
Yin, AdWords API Team. 
Message has been deleted

SeriousJ

unread,
Apr 13, 2016, 4:23:42 AM4/13/16
to AdWords API Forum
Hi Yin,

It works, thank you!

I can't get the campaignTargeting field when selecting retrieving the FeedItem.

    $selector = new Selector();
    $selector->fields = array("FeedId", "Status", "CampaignTargeting");

I tried "CampaignTargeting" and  "campaignTargeting" but I get the following error message: SelectorError.INVALID_FIELD_NAME @ selector;

Thank you.

SeriousJ

unread,
Apr 13, 2016, 6:06:12 AM4/13/16
to AdWords API Forum
Hi again,

I tried "TargetingCampaignId". I don't get an error message anymore but the campaignTargeting field remains blank although there are CalloutFeedItem assigned to some campaigns.

Thank you.

Yin Niu

unread,
Apr 13, 2016, 11:08:57 AM4/13/16
to AdWords API Forum
Hi, 

I believe the FeedItemCampaignTargeting field is a field you set to specify what campaign this extension can serve with. 

SeriousJ

unread,
Apr 13, 2016, 11:17:10 AM4/13/16
to AdWords API Forum
OK, so the problem remains.

I can retrieve all the FeedItem using the FeedItemService, as you kindly suggested.

However, I don't know to which campaign the FeedItem is associated to. Nor can I know if the FeedItem is a calloutFeedItem.

Below is a sample of what I get using the FeedItemService

FeedItem Object
(
    [feedId] => 35394645
    [feedItemId] => 4031650901
    [status] => ENABLED
    [startTime] => 
    [endTime] => 
    [attributeValues] => 
    [policyData] => 
    [devicePreference] => 
    [scheduling] => 
    [campaignTargeting] => 
    [adGroupTargeting] => 
    [keywordTargeting] => 
    [geoTargeting] => 
    [urlCustomParameters] => 
)

All I have is the feedId and the feedItemId.

Any idea?

Yin Niu

unread,
Apr 13, 2016, 11:38:25 AM4/13/16
to AdWords API Forum
Hi, 

You can use CampaignExtensionSettingService to find the campaignId and feedItems associated with the campaign. 
Reply all
Reply to author
Forward
0 new messages