Add Google Adwords Call Extension to AdGroup using API

512 views
Skip to first unread message

James Mills

unread,
Jul 23, 2014, 3:45:01 AM7/23/14
to adwor...@googlegroups.com
I am successfully adding new AdGroups to the Campaign of my choosing. 

I would now like to add a phone number to be displayed against the ads in that adgroup. I understand this to be an Call Extension. Looking into this I have found that this needs to be added using the API Feed Service (http://goo.gl/LzkI4g). I understand that this works the same as adding SiteLinks and I have found this example examples/AdWords/v201406/AdvancedOperations/AddSitelinks.php in the PHP client library. 

I have reworked this to add a CALL rather than SITELINKS. I have also reworked this to add this feed to the AdGroup rather than the Campaign. https://gist.github.com/jamesmills/675fa4574484468a04a5

My first question is: 

Every time I add a Feed it says the name needs to be unique. Does this mean I can create one Feed item of this type and then just reuse it and only add the attributes needed for the AdGroup? So I guess I mean add one Feed for the Campaign and then just update the phone number and country code for each individual adgroup?

Josh Radcliff (AdWords API Team)

unread,
Jul 23, 2014, 6:26:36 PM7/23/14
to adwor...@googlegroups.com
Hi,

We generally recommend creating one Feed per extension type, so in your case I would have:
Note that you could also set up a CampaignFeed if all of the ad groups in the campaign should use the same call extension.

Cheers,
Josh, AdWords API Team

James Mills

unread,
Jul 24, 2014, 2:02:36 AM7/24/14
to adwor...@googlegroups.com
Hi Josh,

Thank you so much for your reply, a speedy one at that!

  1. When you create a Feed object does that then live in the account accessible by all Campaigns and all AdGroups? I know the name is unique but what's the container for it to be unique in? For example, this is what I am thinking?
    1. Create a Campaign (one time action).
    2. Create a call extension Feed object (one time action).
    3. Create a FeedItem with the distinct phone number etc. (multiple)
    4. Create the AdGroup to use the FeedItem (multiple)
    5. Link the AdGroup and the FeedItem using AdGroupFeed (multiple)
    6. Continue to make any Ads etc. within the AdGroup
  2. I am guessing that a Feed object is unique to the Adwords Customer account so to get the Feed object id for the call extension is there an API method you can call? I don't seem to be able to fine it?
Thanks again,

James Mills
Lead Developer, Clicksco PHP Team


Josh Radcliff (AdWords API Team)

unread,
Jul 24, 2014, 11:17:51 AM7/24/14
to adwor...@googlegroups.com
Hi James,

Please see my responses below in blue.

Cheers,
Josh, AdWords API Team


On Thursday, July 24, 2014 2:02:36 AM UTC-4, James Mills wrote:
Hi Josh,

Thank you so much for your reply, a speedy one at that!

  1. When you create a Feed object does that then live in the account accessible by all Campaigns and all AdGroups? Yes - Feeds are created at the account level and can be used by all objects (campaigns, ad groups, etc.) within the account. I know the name is unique but what's the container for it to be unique in? It must be unique across the entire account. For example, this is what I am thinking? The approach below is fine. If you wanted to use the same FeedItem for all call extensions in a campaign, you could instead create a single CampaignFeed. Basically, AdWords will use the most specific match among CustomerFeed, CampaignFeed, and AdGroupFeed for a given impression.
    1. Create a Campaign (one time action).
    2. Create a call extension Feed object (one time action).
    3. Create a FeedItem with the distinct phone number etc. (multiple)
    4. Create the AdGroup to use the FeedItem (multiple)
    5. Link the AdGroup and the FeedItem using AdGroupFeed (multiple)
    6. Continue to make any Ads etc. within the AdGroup
  1. I am guessing that a Feed object is unique to the Adwords Customer account (correct!) so to get the Feed object id for the call extension is there an API method you can call? I don't seem to be able to fine it?
You have two options here:
 a. Use the Customer/Campaign/AdGroupFeedService to find the Customer/Campaign/AdGroupFeed with placeholderTypes containing 2 (for CALL), and then inspect its matchingFunction to determine the FeedItem IDs.
 b. Use the Placeholder Feed Item Report with includeZeroImpressions set to true, and look/filter for rows where PlaceholderType is equal to 2, and grab the FeedId and FeedItemId from those rows. This option seems simpler to me, since you won't have to interpret the matching function.

James Mills

unread,
Jul 29, 2014, 8:31:34 AM7/29/14
to adwor...@googlegroups.com
Hi Josh,

Thank you very much for your reply, this entire thread has been extremely valuable.

So this is what I am doing.

  1. Get or create a unique Feed item. In my case it is a Call Extensions Feed.
  2. Create a FeedItem for a given phone number. This matches the feedAttributeId to the value I want to set.
  3. Next step is to use either CampaignFeedOperation or AdGroupFeedOperation to link the FeedItem to a Campaign or an AdGroup.

I found from the example there is also the stage of running the FeedMappingService. This seems to map the feedAttributeId's to PLACEHOLDER's. I am guessing that this should be run just after creating the new Feed?

Cheers, James

Josh Radcliff (AdWords API Team)

unread,
Jul 29, 2014, 9:37:57 AM7/29/14
to adwor...@googlegroups.com
Hi James,

Glad to hear that this thread has been helpful! Your plan below looks reasonable to me as long as you also add a step to create the FeedMapping, as you mentioned. You can create the FeedMapping after either step 1 or step 2, whichever is better for your application flow. The key is to have the FeedMapping in place before you create the CampaignFeed or AdGroupFeed.

Thanks,
Josh, AdWords API Team

James Mills

unread,
Jul 29, 2014, 10:31:47 AM7/29/14
to adwor...@googlegroups.com
Hi again,

I am now successfully, to an extent, doing what I need to do. The only thing that's a little odd is when I log in and go to edit the number when I click 'save' I get this 


Any ideas, apart from go back and rewrite everything?

Cheers, James

Josh Radcliff (AdWords API Team)

unread,
Jul 29, 2014, 11:42:05 AM7/29/14
to adwor...@googlegroups.com
Hi James,

Could you pass along the feed ID, campaign ID, and ad group ID (if applicable) where you are seeing that error?

Thanks,
Josh, AdWords API Team

James Mills

unread,
Jul 29, 2014, 3:18:38 PM7/29/14
to adwor...@googlegroups.com
Hi,

Feed ID 18963918
Adgroup ID 13788225903 

James

Josh Radcliff (AdWords API Team)

unread,
Jul 29, 2014, 5:20:14 PM7/29/14
to adwor...@googlegroups.com
Hi James,

One issue I see with some of the other feed items is that the country code is in lowercase ("gb"), but the API is expecting uppercase. That's why you see "Afghanistan" selected as the country for the other call extensions.

Regarding the error on save for ad group ID 13788225903, my theory is that this is due to the Count calls as phone call conversions option being checked under Advanced. If you uncheck that box, does the save still show an error?

Thanks,
Josh, AdWords API Team

James Mills

unread,
Jul 30, 2014, 1:45:57 AM7/30/14
to adwor...@googlegroups.com
Hi Josh,

Thanks for looking into this.

I noticed that the country was listed as 'Afghanistan' so I inspected the live site and noticed they should be uppercase. Link from the docs or an example would help.

I was looking at the placeholder docs https://developers.google.com/adwords/api/docs/appendix/placeholders and noticed I have not included the CONVERSION TYPE ID so I suspect this is causing the issue. I had thought that maybe if I missed it out I would not have to reference anything but it looks like I need to give a AdCallMetricsConversion object...


James

James Mills

unread,
Jul 30, 2014, 3:39:25 AM7/30/14
to adwor...@googlegroups.com
Saying that I cannot see a way to set the "Report phone call conversions : Count calls as phone call conversions" & "Conversion Action" settings.

I thought maybe that I need to set the Conversion Type Id to be the Id of an AdWordsConversionTracker Object but then you would have to create a new AdWordsConversionTracker object first and then get the Id and... 

Confusing myself I think.

James Mills

unread,
Jul 30, 2014, 7:48:35 AM7/30/14
to adwor...@googlegroups.com
UPDATE

I added a 'CONVERSION TYPE ID' but still had the issue. Turned out I had forgotten to add 'TRACKED' to the Feed and FeedItem etc. this is what was giving us the error.

I was trying to save some lines of code by omitting them but turns out I ended up causing myself (and you) more pain than was needed. I have now added all options and I am able to edit this in Adwords Admin area now.

The issue with having to include the 'CONVERSION TYPE ID' is that you then have to make sure you have a 'AdCallMetricsConversion object' created and so you can use that Id. I guess there are are a couple of options for this and so I will give it some more thought.

Thanks again Josh, you have been a great help!

James

Josh Radcliff (AdWords API Team)

unread,
Jul 30, 2014, 9:26:50 AM7/30/14
to adwor...@googlegroups.com
Hi James,

Thanks for the update. Based on your suggestion, I've got a change in the works to add the word "Uppercase" to the beginning of the description for COUNTRY CODE on the placeholders page.

I'm also going to look into whether we need to update that doc with better indicators of what's required and what's not. I see that we currently say that TRACKED defaults to true, but your experience suggests otherwise.

Cheers,
Josh, AdWords API Team

James Mills

unread,
Jul 31, 2014, 1:31:27 AM7/31/14
to adwor...@googlegroups.com
Hi Josh,

Yes, it would seem that although the value is true by default if the Feed does not have the field loaded and mapped then it has nothing to save it against when you try and update values in the FeedItem. That's my guess anyway. What I have done now is just included entries for all the FeedAttribute )phone, code, tracking , call only and conversion type) when creating the Feed and also include them all when doing the FeedMapping. 

When creating a FeedItem I miss out the Conversion Type Id and it uses the 'Calls from ads' Conversion action by default if you have tracking turned on (Google forwarding number) so that works out OK.

Question: The only thing I don't seem to be able to change at the moment is the 'Device preference - Mobile' box. I want to be able to select (tick) and not. I am not sure if this has anything to do with it, I am using this from the SiteLinks example adapted from the CampaignFeedOperation example


Thanks for looking at the other changes.

James

Josh Radcliff (AdWords API Team)

unread,
Aug 1, 2014, 2:36:51 PM8/1/14
to adwor...@googlegroups.com
Hi James,

Regarding the device preference, are you saying that the UI won't let you check/uncheck mobile targeting?

Thanks,
Josh, AdWords API Team

James Mills

unread,
Aug 1, 2014, 4:44:31 PM8/1/14
to adwordsapia...@google.com, adwor...@googlegroups.com
Hiya,

No, how do you select that using the API? All UI stuff works now.

Thanks for all your help!

Josh Radcliff (AdWords API Team)

unread,
Aug 4, 2014, 12:05:04 PM8/4/14
to adwor...@googlegroups.com, adwordsapia...@google.com
Hi James,

The platform targeting section of our sitelinks guide shows how to target specific device types.

Thanks,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages