Hi there,
This is somewhat related to an earlier discussion I had with Nadine
Sundquist here:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/adwords-api/szTBX5B5d8E/jkRkPuOMDgAJ
I would like to generate sitelinks that are shared between multiple
campaigns using the Batch Service, preferably with a single batch job.
Assuming this is possible, what sort of operations will I need to use to
achieve this? In my particular case, all of the campaigns will already have
been created, and I have their ids, but the sitelinks may or may not exist
yet.
In the case where the sitelinks are new, I have tried something like this
(I'm using Ruby, and in this case I made the campaigns earlier in the Batch
Job and used pseudo ids, but that probably shouldn't matter):
extension_setting = {
xsi_type: 'ExtensionSetting',
extensions: [
feed_item_id: -5,
xsi_type: 'SitelinkFeedItem',
sitelink_text: 'Store Hours',
sitelink_final_urls: {
urls: ['http://www.example.com/']
}
]
}
campaign_extension1 = {
campaign_id: -2,
extension_type: 'SITELINK',
extension_setting: extension_setting
}
campaign_extension1_op = {
xsi_type: 'CampaignExtensionSettingOperation',
operator: 'ADD',
operand: campaign_extension1
}
campaign_extension2 = {
campaign_id: -4,
extension_type: 'SITELINK',
extension_setting: extension_setting
}
campaign_extension2_op = {
xsi_type: 'CampaignExtensionSettingOperation',
operator: 'ADD',
operand: campaign_extension2
}
# ops here contains operations to generate campaigns with ids -2 and -4 as
well
ops = ops << campaign_extension1_op << campaign_extension2_op
But the response contained a DUPLICATE_ELEMENT error on the
campaign_extension_2_op operation.
{
"result": {
"campaign_extension_setting": {
"extension_type": "SITELINK",
"extension_setting": {
"extensions": {
"feed_id": "20505208",
"feed_item_id": "11262219902",
"status": "ENABLED",
"feed_type": "SITELINK",
"extension_feed_item_type": "SitelinkFeedItem",
"sitelink_text": "Store Hours",
"sitelink_final_urls": {
"urls": "http://www.example.com/"
}
},
"platform_restrictions": "NONE"
}
}
},
"index": "12"
},
{
"error_list": {
"errors": {
"field_path":
"operations[13].operand.extensionSetting.extensions[0].feedItemId",
"trigger": "TempFeedItemId{id=5}",
"error_string": "DistinctError.DUPLICATE_ELEMENT",
"api_error_type": "DistinctError",
"reason": "DUPLICATE_ELEMENT"
}
},
"index": "13"
}
There are many other operation permutations that conceivably could work
(including some combination of FeedItemOperations and
CampaignExtensionSettingOperations, for instance), so I thought I would
reach out before I attempted to test all of them. For both the case of new
sitelinks and existing sitelinks (where I have a feed item id), what
operations should I use to attach these sitelinks to multiple campaigns
within a Batch Job?
Thanks,
- Alex
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/f06ef2be-6fa3-48f2-9bac-7cf754245eb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.