Migration from CampaignAdExtensionPage

46 views
Skip to first unread message

rcapp...@gmail.com

unread,
Apr 13, 2016, 4:42:47 PM4/13/16
to AdWords API Forum
Hello everyone!

There is a legacy system I'm fixing to start using the new APIs. Some calls are easy to translate into the new service. However, some of them looks like obscure functions, like "CampaignAdExtensionPage". 

This was present, I believe, until the 2014  series. I don't know what it was supposed to do exactly, but here is the snippet where this is used:

    static public function convertCampaignAdExtension (\CampaignAdExtensionPage $CampaignAdExtensionPage) {
        $result = [];
        if ($CampaignAdExtensionPage->entries != null) {
            $result = array_reduce($CampaignAdExtensionPage->entries, function (&$result, $AdwordsCampaignAdExtension) {

                if ($AdwordsCampaignAdExtension->adExtension instanceof \LocationExtension) {
                    $result[] = CampaignAdExtension::fromAdwords($AdwordsCampaignAdExtension);
                }

                return $result;
            }, array());
        }

        return $result;
    } 


The question is: which services supplies what CampaignAdExtension used to? Which information does CampaignAdExtensionPage retrieves and what is today's equivalent? 



Thank you in advance!

Umesh Dengale

unread,
Apr 14, 2016, 8:52:26 AM4/14/16
to AdWords API Forum
Hello,

You could manage ad extensions using the extension setting services. Ad extensions can be added at the account (CustomerExtensionSettingService), campaign(CampaignExtensionSettingService), or ad group level (AdGroupExtensionSettingService). Please check out Extension Setting Services guide and AddSiteLinks Java example code from the client library. Other languages example code could be found here.

Cheers,
Umesh, AdWords API Team.

rcapp...@gmail.com

unread,
Apr 22, 2016, 8:59:03 AM4/22/16
to AdWords API Forum
Hello!

This seems to have solved the problems with the CampaignAdExtensionPage, but I'm not sure what to do with the Sitelinks service.

I'm using the FeedService to try to add new Sitelinks, but I'm getting an UrlError (DESTINATION_URL_DEPRECATED). There were some calls to this parameter, indeed, but I've already switched them to FinalUrls (not sure if I did it right). I cannot find any other explicit call to this, and I still get the same error when I call the "mutate" function:

        $feedItemService
= $this->adwords_user->GetService('FeedItemService', \Adwords\Facade::ADWORDS_LIB_VERSION);

       
// Create operations to add FeedItems.
        $operations
= [];

       
(...)

        $result
= $feedItemService->mutate($operations);



Why is this happening?


Thank you in advance!

Umesh Dengale

unread,
Apr 22, 2016, 12:59:17 PM4/22/16
to AdWords API Forum
Hello,

The DESTINATION_URL_DEPRECATED error occurs when try to set the destination url which is deprecated. You need to set the finalUrls field instead. Please check out AddSitelinksUsingFeeds PHP example code and Populate the feed section from the introduction to feed services guide for more details. I would recommend using the extension setting services instead of Feed Services.

Regards,
Umesh, AdWords API Team.

rcapp...@gmail.com

unread,
Apr 27, 2016, 1:10:31 PM4/27/16
to AdWords API Forum
Hello,

I managed to fix it following the instructions on how to move from FeedIemService to CampaignExtensionSettingService.  I'm able to write the Sitelinks into AdWords now. If I stumble into any other Ad Extension trouble I get in touch.

Thank you!
Reply all
Reply to author
Forward
0 new messages