DistinctError.DUPLICATE_ELEMENT while updating keyword destination urls with bulk BiddableAdGroupCriterion mutate

137 views
Skip to first unread message

Michael Ni

unread,
May 31, 2014, 7:46:50 PM5/31/14
to adwor...@googlegroups.com
I am doing bulk operations where I am updating destination urls of keywords
      {
        :xsi_type => 'AdGroupCriterionOperation',
        :operator => 'SET',
        :operand => {
          xsi_type: 'BiddableAdGroupCriterion',
          ad_group_id: ad_group_id,
          criterion: {
            xsi_type: 'Keyword',
            id: keyword_id,            
          },
          destination_url: url,
        }
      }

however for some of them, I get

{:field_path=>"operations[197]",
      :trigger=>nil,
      :error_string=>"DistinctError.DUPLICATE_ELEMENT",
      :api_error_type=>"DistinctError",
      :reason=>"DUPLICATE_ELEMENT",
      :xsi_type=>"DistinctError"}


my suspicion is that when a keyword is
 :approval_status=>"PENDING_REVIEW",

that additional mutate on the same keyword will trigger this.

am i wrong?

if I am wrong, what would cause the duplicate element error?  out of a batch of 10000 i tried looking for another operation with the same keyword and couldn't find any

Josh Radcliff (AdWords API Team)

unread,
Jun 2, 2014, 1:23:34 PM6/2/14
to adwor...@googlegroups.com
Hi,

Are you passing more than one AdGroupCriterionOperation for the same ad_group_id and criterion.id in the same request? It's possible that the API rejects such requests because one of the operations will overwrite the other.

Thanks,
Josh, AdWords API Team

Filipe Costa

unread,
Jul 10, 2014, 4:04:52 PM7/10/14
to adwor...@googlegroups.com
Josh, what are you saying exactly? If I send more than one AdGroupCriterionOperation, for same ad_group_id and keyword_id, in the same request, it will reject n -1 and consider just one? Or will it reject all?

Thanks

Josh Radcliff (AdWords API Team)

unread,
Jul 10, 2014, 5:35:11 PM7/10/14
to adwor...@googlegroups.com
Hi,

If you specify partialFailure true then yes, the first one will succeed and the rest will fail. If you do not specify partialFailure or set it to false, then all of the operations will fail and you'll get a SOAP fault.

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