Adding FinalURLs for Keywords Using Incremental Batch Job

92 views
Skip to first unread message

Edward Bernays

unread,
Feb 12, 2018, 3:01:31 PM2/12/18
to AdWords API Forum
Hello,


I'm trying to modify that code to upload a final URL for each keyword. This is what my call looks like:

  def BuildAdGroupCriterionOperations(keyword_list):        
            criterion_operations
= [
               
{
                   
'xsi_type': 'AdGroupCriterionOperation',
                   
'operand': {
                       
'xsi_type': 'BiddableAdGroupCriterion',
                       
'adGroupId': keyword[2],
                       
'criterion': {
                           
'xsi_type': 'Keyword',
                           
'text': keyword[0],
                           
'matchType': 'BROAD',
                       
},
                       
# These fields are optional.
                       
'userStatus': 'PAUSED',
                       
'finalUrls': {
                           
'urls': keyword[1],
                       
},  # The finalURLs is causing an error
                   
},
                   
'operator': 'ADD'
               
}
               
for keyword in keyword_list]


           
return criterion_operations
keyword_lists is a list of lists that looks like this: [[keyword, final_url, adgroup_id],[keyword, final_url, adgroup_id], ext...]

This is the error I'm getting: 
Operation 0 - FAILURE:
errorType=AdGroupCriterionError
trigger=None
errorString=AdGroupCriterionError.CANNOT_MODIFY_URL_FIELDS_WITH_DUPLICATE_ELEMENTS
fieldPath=operations[0].operand
reason=CANNOT_MODIFY_URL_FIELDS_WITH_DUPLICATE_ELEMENTS
The script works fine if I comment out the finalURLs part.

Vincent Racaza (AdWords API Team)

unread,
Feb 12, 2018, 11:17:43 PM2/12/18
to AdWords API Forum
Hi Edward,

The CANNOT_MODIFY_URL_FIELDS_WITH_DUPLICATE_ELEMENTS error means that you are not allowed to modify any URL fields if you have duplicate elements for the ad group criterion in the request. Since you are adding a criterion in batch, can you confirm if there are no duplicate elements in your request (two criteria with the same keyword, final URL and ad group ID)?

If you can confirm that there are no duplicate elements on your end and still the error persists, then can you enable your SOAP logs and provide to me the SOAP request and response of your uploaded operation as well as your batch job ID via Reply privately to author option?

Thanks,
Vincent
AdWords API Team

Edward Bernays

unread,
Feb 14, 2018, 11:16:24 AM2/14/18
to AdWords API Forum
Hello,
Just making sure you got my private message.

Vincent Racaza (AdWords API Team)

unread,
Feb 18, 2018, 11:00:02 PM2/18/18
to AdWords API Forum
Hi Edward,

My apologies for the delayed response as I have checked this with the rest of the team.

Upon further checking, you have duplicated the keyword "Icon Womens Pursuit Motorcycle Gloves" multiple times. To solve this issue, you just need to set another value of keyword for one specific ad group.

Let me know if this solves your issue after doing the suggestion.

Edward Bernays

unread,
Feb 20, 2018, 4:01:51 PM2/20/18
to AdWords API Forum
Hi Vincent,
That does not seem to be the issue. I printed out the list that the for loop is using and it contains no duplicates. Here is the list:

[['Icon Pursuit Motorcycle Gloves', 'https://fortnine.ca/en/icon-pursuit-motorcycle-gloves', 53659821962], ['Icon Womens Pursuit Motorcycle Gloves', 'https://fortnine.ca/en/icon-pursuit-womens-motorcycle-gloves', 53659821962], ['Icon 29er Motorcycle Gloves', 'https://fortnine.ca/en/icon-29er-motorcycle-gloves', 53659821962], ['Icon Womens 29er Motorcycle Gloves', 'https://fortnine.ca/en/icon-29er-womens-motorcycle-gloves', 53659821962], ['Icon Womens Hella Leather Jacket', 'https://fortnine.ca/en/icon-hella-leather-motorcycle-jacket', 53659821962], ['Alpinestars RJ-5 Rain Jacket', 'https://fortnine.ca/en/alpinestars-rj-5-rain-jacket', 53659822442], ['Alpinestars Tech 3 Boots - 2016', 'https://fortnine.ca/en/alpinestars-tech-3-boots-2016', 53659822442], ['Alpinestars Tech 3 All Terrain Boots', 'https://fortnine.ca/en/alpinestars-tech-3-all-terrain-boots', 53659822442], ['Alpinestars Womens Stella Tech 3 Boots - 2016', 'https://fortnine.ca/en/alpinestars-stella-tech-3-boots', 53659822442], ['Alpinestars GP Knee Slider', 'https://fortnine.ca/en/alpinestars-gp-knee-slider', 53659822442], ['Alpinestars Womens Stella Tech Spoiler', 'https://fortnine.ca/en/alpinestars-stella-tech-spoiler', 53659822442], ['Alpinestars Compression Pro Shorts', 'https://fortnine.ca/en/alpinestars-compression-pro-shorts', 53659822442], ['Alpinestars Neck Roll Adult', 'https://fortnine.ca/en/alpinestars-neck-roll-adult', 53659822442], ['Alpinestars Touring Socks', 'https://fortnine.ca/en/alpinestars-touring-socks', 53659822442], ['Alpinestars Thermal Tech Socks', 'https://fortnine.ca/en/alpinestars-thermal-tech-socks', 53659822442], ['Alpinestars Skull Cap Beanie', 'https://fortnine.ca/en/alpinestars-skull-cap-beanie', 53659822442], ['Alpinestars Winter Balaclava', 'https://fortnine.ca/en/alpinestars-winter-balaclava', 53659822442], ['HJC CS-5N Solid Helmet', 'https://fortnine.ca/en/hjc-cs-5n-helmet', 53659821762], ['HJC CS-2N Solid Helmet', 'https://fortnine.ca/en/hjc-cs-2n-helmet', 53659821762], ['HJC AC-3/CL-33 Shield', 'https://fortnine.ca/en/hjc-ac-3-cl-33-shield', 53659821762], ['Z1R Ace Shield', 'https://fortnine.ca/en/hjc-fs-3-shield', 53659822042], ['HJC HJ-09 Pinlock Shield', 'https://fortnine.ca/en/hjc-fs-10-is-16-fs-15-cs-r1-cl-15-cl-16-shield', 53659821762], ['HJC CS-2N Shield', 'https://fortnine.ca/en/hjc-cs-2n-shield', 53659821762], ['HJC IS-33 Shield', 'https://fortnine.ca/en/hjc-is-33-shield', 53659821762], ['HJC HJ-17 Shield', 'https://fortnine.ca/en/hjc-is-max-shield', 53659821762], ['HJC HJ-V5 Sun Visor Shield', 'https://fortnine.ca/en/hjc-symax-ii-is-16-is-33-max-sun-visor-shield', 53659821762], ['Shoei VFX-W Motocross Solid Helmet', 'https://fortnine.ca/en/shoei-vfx-w-motocross-helmet', 53659822282], ['Shoei RJ Platinum-R Solid Helmet', 'https://fortnine.ca/en/shoei-rj-platinum-r-helmet', 53659822282], ['HMK Action 2 Gloves', 'https://fortnine.ca/en/hmk-action-snow-gloves', 53659822202], ['HMK Hydrapak Hydration System', 'https://fortnine.ca/en/hmk-hydrapak-hydration-system', 53659822202], ['HMK Whistle', 'https://fortnine.ca/en/hmk-whistle', 53659822202], ['Thor Mud Suit', 'https://fortnine.ca/en/thor-mud-suit', 53659822242], ['Thor Enemy Goggles', 'https://fortnine.ca/en/thor-enemy-goggles', 53659822242], ['Thor Youth Enemy Goggles', 'https://fortnine.ca/en/thor-enemy-youth-goggles', 53659822242], ['Thor Static Kneeguard', 'https://fortnine.ca/en/thor-static-kneeguard', 53659822242], ['Thor Static Elbowguard', 'https://fortnine.ca/en/thor-static-elbowguard', 53659822242], ['Thor Force Belt - 2015', 'https://fortnine.ca/en/thor-force-belt-2015', 53659822242], ['Kuryakyn GranTailgater Bag - 4172', 'https://fortnine.ca/en/kuryakyn-grantailgater-bag', 53659822002], ['Kuryakyn Grantraveler Bag - 4149', 'https://fortnine.ca/en/kuryakyn-grantraveler-bag', 53659822002], ['Kuryakyn Custom Roll Bag - 4166', 'https://fortnine.ca/en/kuryakyn-custom-roll-bag', 53659822002], ['Kuryakyn Classic Tour Bag - 4144', 'https://fortnine.ca/en/kuryakyn-classic-tour-bag', 53659822002], ['Scorpion EXO-100/EXO-C110 SpeedView Sun Visor', 'https://fortnine.ca/en/scorpion-speedview-sun-visor-for-exo-100-helmet', 53659821802], ['Scorpion EXO-500/1000/1100 SpeedView Sun Visor', 'https://fortnine.ca/en/scorpion-speedview-sun-visor-for-scorpion-exo-1000-helmet', 53659821802], ['Shoei CW-1 Shield', 'https://fortnine.ca/en/shoei-cw-1-shield-for-x-12-and-rf-1100', 53659822282], ['Shoei CW-1 Spectra Shield', 'https://fortnine.ca/en/shoei-cw-1-spectra-shield-for-x-12-rf-1100', 53659822282], ['Shoei GW Spectra Shield', 'https://fortnine.ca/en/shoei-cw-1-spectra-shield-for-x-12-rf-1100', 53659822282]]

The code with the for loop is in my opening post.
Reply all
Reply to author
Forward
0 new messages