Add extensions to multiple ad groups like AdWords UI

62 views
Skip to first unread message

JC Lee

unread,
Mar 19, 2017, 10:04:17 AM3/19/17
to AdWords API Forum
Is there a single operation I can do to add extensions to many ad groups at once?

Is batch job my only option?

JC Lee

unread,
Mar 19, 2017, 10:20:26 AM3/19/17
to AdWords API Forum
I would also like to add or remove extensions from multiple ad groups like the UI? How can I achieve that?

As far as I understand, each ad group's extensions must be set through its AdGroupExtensionSetting -- that which contains ExtensionSetting, essentially an array containing the extensions. If adding or removing, I will have to read each Ad group's ExtensionSetting and add to or remove from the array. 

Problem is doing a bulk operation, I can't be reading each Ad Group on a separate operation. If I have hundreds or thousands of ad groups, it'll take forever to complete.

Ivan Bautista

unread,
Mar 20, 2017, 2:30:46 AM3/20/17
to AdWords API Forum
Hi JC,

Could you provide us a screenshot or point to us where in the AdWords UI you can achieve adding of extensions to multiple ad groups at once?

Currently, there are no available services in the AdWords API that will allow you to add extensions to multiple ad groups at once. Even in BatchJobService, separate operations must be formed and requested for each ad group you want to add extensions to. However, the advantage of executing AdGroupExtensionSettingOperation via BatchJobService over the synchronous service counterpart, AdGroupExtensionSettingService, is that you can perform batches of ADD or REMOVE operations without waiting for them to complete.

Regards,
Ivan
AdWords API Team

JC Lee

unread,
Mar 20, 2017, 4:32:58 AM3/20/17
to AdWords API Forum
Hi Ivan,

See attached files. When you click into a campaign, go to Ad Extensions then below you can select Ad Groups. There you can perform bulk add. After which you can also select the table rows and edit to perform bulk operations (third attachment.)

However, the advantage of executing AdGroupExtensionSettingOperation via BatchJobService over the synchronous service counterpart, AdGroupExtensionSettingService, is that you can perform batches of ADD or REMOVE operations without waiting for them to complete.

If you take a look at the third attachment -- If I want to do a similar bulk removal from ad groups using the API, wouldn't I need to
  1. first, retrieve EVERY ad group's AdGroupExtensionSetting.
  2. Then, make sure they have the Extensions I want to remove.
  3. Then, create an remove operation?
The same thing for adding. Essentially I am doing "Remove extension if exists" and "Add extension if does not exist" on the ad group.

Maybe if I do a BatchJob, the ad groups with incompatible extensions will fail with errors and I should just ignore those?
Capture.PNG
Capture.PNG
Capture.PNG

Ivan Bautista

unread,
Mar 20, 2017, 7:05:00 AM3/20/17
to AdWords API Forum
Hi JC,

Thank you for providing the screenshot. You can achieve similar feature in the AdWords API by executing separate operations for each ad group and not in a single operation.

As you've mentioned, you have to validate first your extensions before executing the operations just like any other.

However, the advantage of executing AdGroupExtensionSettingOperation via BatchJobService over the synchronous service counterpart, AdGroupExtensionSettingService, is that you can perform batches of ADD or REMOVE operations without waiting for them to complete.

With regards to my statement above, I was referring to the context of sending multiple operations wherein BatchJobService has the advantage over AdGroupExtensionSettingService of executing operations asynchronously with the assumption that the field values set for each operations are valid just like when using any other API services. Whether you use BatchJobService or AdGroupExtensionSettingService, it should be considered as a best practice to validate that each object or entity to be REMOVED should exist in order to avoid errors.

JC Lee

unread,
Mar 20, 2017, 9:15:37 AM3/20/17
to AdWords API Forum
Hi Ivan,

With regards to my statement above, I was referring to the context of sending multiple operations wherein BatchJobService has the advantage over AdGroupExtensionSettingService of executing operations asynchronously with the assumption that the field values set for each operations are valid just like when using any other API services. Whether you use BatchJobService or AdGroupExtensionSettingService, it should be considered as a best practice to validate that each object or entity to be REMOVED should exist in order to avoid errors.

Which means to do a similar (to AdWords UI) bulk operation on multiple ad groups I would need to at least do two separate BatchJob operations. One after the other. (BatchJob 1, get all. My application validates then send BatchJob 2 to mutate.)

The application I am building has to work with upwards of hundreds of ad groups per campaign. The RMF requires me to support extensions on Ad Groups, but in this case it looks like the API support for it is lacking.

May I request that this feature be added to the API since it's in the AdWords UI?

To make it clear, I am asking for the ability to synchronously perform these operations:
  • Add extensions to many ad groups
  • Remove extensions from many ad groups

Ivan Bautista

unread,
Mar 21, 2017, 2:49:11 AM3/21/17
to AdWords API Forum
Hi JC,

Yes, validation of your extensions should be done separately from removal of extensions. However, for adding of extensions, you might not need to validate because the ADD and SET operator for AdGroupExtensionSettingService.mutate() are treated identically so if you try to ADD an existing extension, it will just be treated as a SET operation.

As for your last statement, I want to clarify that you want to have the option to send a single operation for adding or removing of extensions to multiple ad groups wherein you can specify an array of ad groups and array of extensions in a single operation? I will try to raise this to the team but I can't guarantee that it will be added to future release.

However, you may try to achieve similar behavior by:
  1. Getting the list of ad groups
  2. Traversing through each ad group and validate existing extensions (validation could possibly be for REMOVE operation only)
  3. Perform multiple separate REMOVE or ADD operation of extensions to each ad group
The decision to do Step 3 synchronously via AdGroupExtensionSettingService or asynchronously via BatchJobService or your own mechanism depends on your design. In addition, here's a guide in managing ad extensions via Extension Setting Services.

JC Lee

unread,
Mar 21, 2017, 5:43:30 AM3/21/17
to AdWords API Forum
Hi Ivan,

As for your last statement, I want to clarify that you want to have the option to send a single operation for adding or removing of extensions to multiple ad groups wherein you can specify an array of ad groups and array of extensions in a single operation?

Yes. I want to be able to perform bulk changes synchronously like AdWords UI.

While working with the Extension Setting Services, I also found some inconveniences. Please correct me if I am wrong here.

For example, if I want to update an extension feed item -- it would have to be set in either Customer, Campaign or Ad Group because I can only access them in their respective ExtensionSettings. If I want to update them and they are not set within these entities, I would have to use Feed Services. It wouldn't be so much of a problem if I can use the concrete feed items like CalloutFeedItem like in the rest of my application, but in Feed Services, I must first convert them to FeedItem. The conversion process is particularly difficult as it requires that I retrieve the Feed and FeedMapping and use the placeholder Ids. Then, manually set each attribute.

The same is true for getting the list of available extensions. In AdWords UI, the list of available extensions in the add panel are on the left. I have replicated the UI in my app. In order to get the list of available extensions, I can also only use Feed Services. Whereas setting/adding them into Customer, Campaign or Ad Group, I can use Extension Setting Services. So I had to convert them here as well.

Optimally, I would like to be able to update and get a list of extension feed items in their concrete form. e.g. CalloutFeedItem SitelinkFeedItem and so on.

Expanding on retrieving the Feed to do the above: I would need to know which feed to retrieve in the first place. There's no explicit way to know which feeds contains the callouts and so on. I found out that AdWords UI places the callouts in a feed named "Main callout feed" so I am selecting using the feed name in the get operation. As this is not documented, I imagine it can be changed at anytime without notice and thus breaking my application.

Can you please feedback the above to the team as well?

Ivan Bautista

unread,
Mar 22, 2017, 3:39:44 AM3/22/17
to AdWords API Forum
Hi JC, 

Do note that AdWords UI features doesn't always have a direct counterpart in AdWords API. However, if you wish to manage concrete Feed Items such as CalloutFeedItem, then we recommend that you use Extension Setting Services instead. You may follow this guide for adding and updating ad extensions using Extension Setting Services. When retrieving the ad extensions, you can use the ExtensionType field which indicates its type. There are also a number of sample implementation available in different languages that you could refer to.

On the other hand, we already informed the team with regards to your initial request of having a single operation for adding extensions to multiple ad groups. As mentioned earlier, we can't guarantee that it will be included in future releases or when it will be available. In the meantime, try the different API services we've shared and follow our blog to check on future updates.
Reply all
Reply to author
Forward
0 new messages