Hi Nadine,
Thanks for the info. I've looked at the examples and the documentation, and while they are very clear for the simple case (each campaign has a separate set of sitelinks), it isn't clear to me what to do if I want to share the same sitelinks across multiple campaigns (similar to how the Shared Library works in the Adwords UI).
It sounds like you are suggesting that I run the mutate "add" action to each campaign for some set of SiteLinkFeedItems using the CampaignExtensionSetting service. As you said, the mutate "add" operation both creates the sitelinks and creates the mappings. Because of that, I'm under the impression that running the mutate "add" operation on multiple campaigns with the same SiteLinkFeedItems (and specifically, new ones, i.e. without ids) would attempt to re-create the sitelinks, and I would either end up with duplicate copies of the sitelinks, or Adwords would reject the request because the sitelinks already exist. Is this the behavior? Or does the API figure out that it has received sitelinks that already exist, and uses the existing ones rather than trying to create more (despite not being provided IDs)?
I can do this with the old-style FeedItems already - the steps would be something like:
- Create the sitelinks using the FeedItem service and get the feed item ids from the response (1,2,3,4,5)
- Create a matching function for a campaign feed, something like "feed_item_id IN (1,2,3,4,5)".
- Create a CampaignFeed for each campaign id I want to map to using the matching function generated in step 2.
It sounds like, to do this with extension settings, you're suggesting something like this:
- Build an ExtensionSetting containing all the sitelinks I want to create and map.
- Build CampaignExtensionSettings using the ExtensionSetting from step 1 for each campaign id I want mapped.
- Build CampaignExtensionSettingOperations using the CampaignExtensionSettings from step 2 and the ADD operator. (this is the step I'm wondering about, specifically the ADD operator)
- Use the CampaignExtensionSettingService to push the array of operations from step 3 using the mutate call.
Intuitively to me this seems like it will fail, because the first operation in the array (built in step 3) will create the sitelinks, and the second and all future operations will try to create the sitelinks again and do something bad (either fail or make duplicates). If the API will handle this properly, please let me know. And thanks again for the help!
- Alex