Hi Alex,

Before I confirm this, let me check with the person here who wrote that 
specific piece of code. I just want to make sure it's exactly correct for 
you. I'll get back to you as soon as I hear back from him.

Cheers,
Nadine, AdWords API Team

On Friday, March 3, 2017 at 12:42:12 PM UTC-5, Alexander Cavalli wrote:
>
> Hi Nadine,
>
> Thanks, I think I've got all the info I need in order to code this out 
> properly. 
>
> I'm not sure I'm totally grokking this whole setup though, so, for my own 
> edification, let me see if I've got this all correct:
>
> 1. ADD and SET are interchangeable on the 
> CampaignExtensionSettingOperation *when you already have a feed item id* and 
> just want to make sure that feed item is mapped to a campaign. The API will 
> detect the mapping already exists, or not, and do the right thing.
> 2. When you don't have a feed item id, you need to use ADD to generate one 
> (to create the feed item, and incidentally the mapping as well).
> 3. A CampaignExtensionSettingOperation with *only* feed item ids in the 
> extension setting list will map those extension settings to the campaign 
> (assuming the ids are valid or are temporary ids created earlier in the 
> batch job).
> 4. A CampaignExtensionSettingOperation with *fully defined feed items* 
> (e.g. text and url in the case of sitelinks) will attempt to modify the 
> extension feed item AND set the mapping.
> 4a. In a Batch Job, you can't submit a fully defined extension feed item 
> <https://groups.google.com/d/msg/adwords-api/5fYvMwZTF0Q/FQFTB-ogAwAJ> 
> (as a child of the CampaignExtensionSettingOperation) with a temporary id 
> in two different campaigns - the second one will attempt to mutate the 
> first one, or redefine it, or something (Duplicate element error). But you 
> can reference the temporary id for the purposes of making a new campaign 
> mapping, and using either SET or ADD (as mentioned in #1). 
>
> Thanks again.
> - Alex
>
> On Friday, March 3, 2017 at 11:04:26 AM UTC-6, Nadine Sundquist (AdWords 
> API Team) wrote:
>>
>> Hi Alex,
>>
>> I absolutely don't mind! I'm glad I can help. Yay!
>> 1. When looking at the ExtensionFeedItem 
>> <https://developers.google.com/adwords/api/docs/reference/v201702/CampaignExtensionSettingService.ExtensionFeedItem>,
>>  
>> the feedId 
>> <https://developers.google.com/adwords/api/docs/reference/v201702/CampaignExtensionSettingService.ExtensionFeedItem#feedid>
>>  and 
>> the feedItemId 
>> <https://developers.google.com/adwords/api/docs/reference/v201702/CampaignExtensionSettingService.ExtensionFeedItem#feeditemid>
>>  can 
>> be keyed off of to determine if the item is unique at the campaign, ad 
>> group, or customer level.
>> 2. The BatchJobService does have logic in place that if a temporary ID 
>> is relied upon by another item in the job, then that kind of order has to 
>> be maintained. You are safe with your use case.
>>
>> Regards,
>> Nadine, AdWords API Team
>>
>> On Friday, March 3, 2017 at 10:52:28 AM UTC-5, Alexander Cavalli wrote:
>>>
>>> Hi Nadine,
>>>
>>> Thanks for the info. A couple more clarifications, if you don't mind! :)
>>>
>>> 1. Reading that doc you sent on SET and ADD being somewhat 
>>> interchangeable, there's a note about "If the SET operator is used in a 
>>> case where an ad extension does not exist, a new ad extension is added." 
>>> What fields is the API using to determine whether or not the extension 
>>> already exists? 
>>> 2. Given that the API doesn't guarantee the order of all the operations, 
>>> does that mean I will need to plan on creating the sitelinks separately 
>>> first, and then adding any additional mappings as part of the batch job? Or 
>>> is it safe for that particular kind of operation for me to create a 
>>> sitelink and then create additional mappings for that same sitelink using 
>>> its temporary id later (within a batch job)? 
>>>
>>> - Alex
>>>
>>> On Thursday, March 2, 2017 at 5:29:54 PM UTC-6, Nadine Sundquist 
>>> (AdWords API Team) wrote:
>>>>
>>>> Hi Alex,
>>>>
>>>> I remember when the idea of having SET and ADD do the same operation 
>>>> <https://developers.google.com/adwords/api/docs/guides/extension-settings#adding_ad_extensions>
>>>>  
>>>> came into being, so I can shed some light on it. From a coding 
>>>> perspective, 
>>>> people found it cumbersome to have to have to do a get() to see if 
>>>> something already existed before deciding if they needed to do a *SET* 
>>>> versus an *ADD*. That was an extra operation, and when you're doing a 
>>>> lot of these, it adds up. It was easier for people just to do a *SET* 
>>>> no matter what. The API could then figure out for them if it needed to be 
>>>> an *ADD* or not. There were fewer calls to the API, and it made the 
>>>> performance of people's applications that run against the API better as a 
>>>> result.
>>>>
>>>> Batch processing does allow for you to create an object earlier in the 
>>>> job, and then mutate it in some way later on in the job. It does rely on 
>>>> that ID. Now, we do recommend against doing that in our Best Practices 
>>>> <https://developers.google.com/adwords/api/docs/guides/batch-jobs#best_practices>.
>>>>  
>>>> The reason we recommend against doing that is because of performance and 
>>>> also that we don't guarantee the order of all the operations. That means 
>>>> some of those mutates() of the newly created object may happen in a 
>>>> different order than you would expect.
>>>>
>>>> I hope that clears it up for you!
>>>>
>>>> Best,
>>>> Nadine, AdWords API Team
>>>>
>>>> On Thursday, March 2, 2017 at 10:05:54 AM UTC-5, Vishal Vinayak 
>>>> (Adwords API Team) wrote:
>>>>>
>>>>> Hi Alex,
>>>>>
>>>>> Thanks for confirming. To your question, you can use either ADD or SET 
>>>>> to add 
>>>>> <https://developers.google.com/adwords/api/docs/guides/extension-settings#adding_ad_extensions>
>>>>>  / update 
>>>>> <https://developers.google.com/adwords/api/docs/guides/extension-settings#update_ad_extensions>
>>>>>  extensions. 
>>>>> I can check with my team and let you know more on the purpose of their 
>>>>> existence as two operators (and not one) and why the batch job behaves 
>>>>> the 
>>>>> way it does. Myself or somebody from my team will get back to you soon.  
>>>>>
>>>>> Regards,
>>>>> Vishal, AdWords API Team
>>>>>
>>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
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/4c7c1ae6-8a48-43fe-b527-317d5e6fb7a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Re: How to sha... Alexander Cavalli
    • Re: How t... 'Vishal Vinayak (Adwords API Team)' via AdWords API Forum
      • Re: H... Alexander Cavalli
        • R... 'Vishal Vinayak (Adwords API Team)' via AdWords API Forum
          • ... Alexander Cavalli
            • ... 'Vishal Vinayak (Adwords API Team)' via AdWords API Forum
              • ... 'Nadine Sundquist (AdWords API Team)' via AdWords API Forum
              • ... Alexander Cavalli
              • ... 'Nadine Sundquist (AdWords API Team)' via AdWords API Forum
              • ... Alexander Cavalli
              • ... 'Nadine Sundquist (AdWords API Team)' via AdWords API Forum
              • ... 'Nadine Sundquist (AdWords API Team)' via AdWords API Forum
              • ... Alexander Cavalli

Reply via email to