Problems setting FinalUrls values on keywords

552 views
Skip to first unread message

Giles Bodger

unread,
Jun 23, 2015, 10:16:06 AM6/23/15
to adwor...@googlegroups.com
Hi all

We have made a change to our API integration that now sets the finalUrls value and not the destinationUrl on a BiddableAdGroupCriterion when adding a keyword to an AdGroup and Campaign.

We have been seeing a couple of weird errors though

1. When adding a COMPLETELY NEW campaign i can create a BiddableAdGroupCriterion and set the finalUrls value (new string[] {"myurl"}) and i do nothing with the destinationUrl property. My keyword is created no problem. HOWEVER when i try to apply the same logic to adding a new keyword to a campaign that already exists (but has yet to be migrated (i.e. it isn't July yet)) I am getting this error ....

AdGroupCriterionError.CANNOT_SET_BOTH_DESTINATION_URL_AND_FINAL_URLS

This, i cannot understand because i removed the code that would set my url to the old destinationUrl property, and coded up the setting of the finalUrls.

Does your whole campaign have to have been migrated before you can start to add new entities with a finalUrls value ? Are you not allowed to have keywords in a campaign that some have destinationUrl set and others have finalUrls set ??

I have read that a work around might be to set the detinationUrl to null or an empty string, but that seems to be a hack and in any way the destinationUrl is readonly as of july 1st so trying to set it after that time will give me an error i believe


2. Our internal processes caused a duplication of several new keywords we were adding. All with the finalUrls set, but for whatever reason we created pairs of identical keywords to be added in 1 api call. All good, and we have built in management to account for the errors given back by the interface, BUT the error we got is a little misleading - if indeed it actually means "you have a duplicate in your request" - the error we are getting is ...

AdGroupCriterionError.CANNOT_MODIFY_URL_FIELDS_WITH_DUPLICATE_ELEMENTS

We would have expected an error like "DUPLICATE_ELEMENT" or something, if indeed this is a duplicate error issue



Anyhow, many thanks in advance

Giles



Josh Radcliff (AdWords API Team)

unread,
Jun 23, 2015, 3:59:47 PM6/23/15
to adwor...@googlegroups.com, giles...@googlemail.com
Hi Giles,

On #1, are you sure this is happening when adding a new keyword to an existing campaign's ad group, and not when trying to issue a SET operation that passes the final URLs? To my knowledge, we'll only throw that error in two scenarios:
  1. On a SET where finalUrls is specified, the criterion already has a destinationUrl, and the operation does not set the destinationUrl to empty string ("")
  2. On an ADD where both finalUrls and destinationUrl is specified.
For both #1 and #2, could you pass along the requestIds from the failed responses if you have them? If not, could you provide me with the date/time (including timezone) and ad group and criterion IDs of the failed requests?

Thanks,
Josh, AdWords API Team

Giles Bodger

unread,
Jun 23, 2015, 8:17:56 PM6/23/15
to adwor...@googlegroups.com, giles...@googlemail.com
OK - i have got the soap request and requestId for a test i just ran to example the #1 scenario....

Request made approx 12.57am GMT 23-06-2015

Request header

<soap:Body>
<operations xsi:type="AdGroupCriterionOperation">
<operator>ADD</operator>
<operand xsi:type="BiddableAdGroupCriterion">
<adGroupId>19071444504</adGroupId>
<criterion xsi:type="Keyword">
<text>Epica билеты концерт Krakow</text>
<matchType>EXACT</matchType>
</criterion>
<biddingStrategyConfiguration>
<bids xsi:type="CpcBid">
<bid>
<microAmount>150000</microAmount>
</bid>
</bids>
</biddingStrategyConfiguration>
<finalUrls>
</finalUrls>
</operand>
</operations>
<policy />
</mutate>
</soap:Body>

response from API with requestId - 0005193809ef41390ac445e53b00164b

We send most of out creational operations with the bulk service and the response we got for this attempt was . 



The Soap Response from the BulkService was as follows

<soap:Body>
<rval>
<SimpleMutateResult>
<results>
<PlaceHolder></PlaceHolder>
</results>
<errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AdGroupCriterionError">
<fieldPath>operations[0].operand.finalUrls</fieldPath>
<errorString>AdGroupCriterionError.CANNOT_SET_BOTH_DESTINATION_URL_AND_FINAL_URLS</errorString>
<ApiError.Type>AdGroupCriterionError</ApiError.Type>
<reason>CANNOT_SET_BOTH_DESTINATION_URL_AND_FINAL_URLS</reason>
</errors>
</SimpleMutateResult>
</rval>
</getResultResponse>
</soap:Body>
</soap:Envelope>

Hope that helps, (will also get you a requestId and values for the #2 scenario)

Giles
Message has been deleted

Giles Bodger

unread,
Jun 24, 2015, 9:54:32 AM6/24/15
to adwor...@googlegroups.com
Just so you know Josh, I can send the same scenario #1 request to our QA sandbox environment and the creation succeeds.

New Keyword with finalurl set, destinationUrl not set, for an existing adgroup and campaign (the adgroup now contains a mix of keywords some with destinationUrl set some with finalUrls set )

cheers

Giles Bodger

unread,
Jun 25, 2015, 8:05:32 PM6/25/15
to adwor...@googlegroups.com, giles...@googlemail.com
Hi Josh - ok so it looks like we were trying to add a keyword text / match type combination that already existed. But we were actually trying to Add and not update. So the system is smart enough to think that if there is already a match on keyword and  matchtype within the adgroup you are trying to add to, it tries to update the existing criterion. 

We can solve the issue by setting all destinationUrls to an empty string "" while we are setting the finalUrls to the actual landing page. Is it something we can simply leave in our code so as to "set" the destinationUrl field to empty string by default. And if so, will this be possible after the 1st of July, as from that date the destinationUrl field becomes read only ??

Lastly, the scenraio where we were sending in duplicate keywords in the same request. Previously if this had happened while setting the destinationUrl properties we would have had 2 successful operations each given the same criterion immutable id. Now it appears that if we do this but with the duplicate keywords having the finalUrls set we get both operations erroring with the .CANNOT_MODIFY_URL_FIELDS_WITH_DUPLICATE_ELEMENTS error. Am i right in saying that the creational operations have become more strict? Not a problem and totally down to our side not deduping, but just want to clarify that with you 

cheers

On Tuesday, June 23, 2015 at 8:59:47 PM UTC+1, Josh Radcliff (AdWords API Team) wrote:

Josh Radcliff (AdWords API Team)

unread,
Jun 26, 2015, 12:09:21 PM6/26/15
to adwor...@googlegroups.com, giles...@googlemail.com
Hi Giles,

Thanks for helping identify the change in behavior with duplicate keywords. I'm following up with the upgraded URLs team to see if this was intentional. I'll post back once I have an update.

As to whether you'll be able to continue to pass "" for destinationUrl after July 1st, I'm not aware of any plans to change the behavior of that particular validation, so you should be fine. Note, though, that the destinationUrl field may eventually go away completely in a future version of the API. When and if that happens, you'll presumably have to remove your code that's setting that attribute.

Thanks,
Josh, AdWords API Team

Giles Bodger

unread,
Jun 26, 2015, 2:24:15 PM6/26/15
to adwor...@googlegroups.com, giles...@googlemail.com
No problem, and yes we will change our code accordingly as and when the destinationUrl property is removed - 

cheers for your help Josh

HK

unread,
Jun 29, 2015, 7:50:42 PM6/29/15
to adwor...@googlegroups.com
Guys, not sure if this will help or confuse, but we have a unit test for Product Groups that have been working every day for at least the last six months, but started failing 5/31 with the CANNOT_MODIFY_URL_FIELDS_WITH_DUPLICATE_ELEMENTS error. I can provide more details if needed, but it seems somewhat similar to what Giles is describing. Here is the scenario:

  1. I have a leaf product group "All products > Everything else in 'All products' > mysupersku" and want to subdivide it by category (mysupersku is a productofferid).
  2. We submit one API call (v201502) to do the following:
    1. Delete the original product partition mysupersku.
    2. Add back the same product partition (mysupersku) as a subdivision. (id - 1)
    3. Add a leaf product partition for BIDDING_CATEGORY_L1 (-4844290245982195030) (id = -2, parent = -1)
    4. Add an excluded leaf product partition for BIDDING_CATEGORY_L1 for the everything else (id = -3, parent = -1).
The destination URL or FinalURLs fields are set to null on all objects and were null before making this call too, so the error seems out of place to me and based on its prior success rate, should still work.

Thanks,
Hans

Josh Radcliff (AdWords API Team)

unread,
Jun 30, 2015, 3:20:07 PM6/30/15
to adwor...@googlegroups.com, hrav...@hotmail.com
Hi Hans,

Thanks for posting these details. Do you happen to have the requestId from one of your requests that failed? I've tried to replicate this issue in my test account, but the request succeeds every time.

Cheers,
Josh, AdWords API Team

HK

unread,
Jun 30, 2015, 7:00:23 PM6/30/15
to adwor...@googlegroups.com, hrav...@hotmail.com
Hi, Josh

I'm still trouble-shooting this, but I just reproduced the error and captured the request ID - 000519c3d3f0bd000abf2547680fa3a5. Now, while doing this, I noticed that the request has ...

<urlCustomParameters><doReplace>true</doReplace></urlCustomParameters>

Taking that out, resolves the issue for me. So it seems to be related to custom parameters and not a URL as the error indicates. I didn't think setting doReplace would have any effect on an ADD operation (https://developers.google.com/adwords/api/docs/reference/v201502/AdGroupCriterionService.CustomParameters).

Giles, I don't mean to hijack your thread. It's possible my issue is not related to yours after all.

Hans

HK

unread,
Jun 30, 2015, 8:03:35 PM6/30/15
to adwor...@googlegroups.com
Josh,

Wanted to add some clarifications to the above. After playing with this some more, it appears that if deleting a product partition and then recreating it again (going from unit to subdiv), the APIs don't accept having different custom parameters for the two, even though they don't have the same ID as it's being brought back with id = -1. The one being deleted had no custom params. The one being recreated (as a subdiv - mysupersku) fails unless I set urlCustomParameters to null. I tried submitting a 0 item array with doReplace to true and false, and also submitting one valid custom parameter, with doReplace to true and false. This seems like an unexpected limitation, although we can work around it.

Hans

Josh Radcliff (AdWords API Team)

unread,
Jul 1, 2015, 10:03:53 AM7/1/15
to adwor...@googlegroups.com, hrav...@hotmail.com
Hi Hans,

Thanks for providing all of the details. I've tried several variants and can't seem to reproduce the behavior you described, but I can see that the request ID you sent did indeed fail with the error you mentioned. I've raised this with the shopping team and asked them to investigate. I'll let you know what they say.

If you have any further details, such as the exact state of all of the nodes of the product partition tree before you tried to do the UNIT -> SUBDIVISION change, could you send that over? There may be subtle differences between your tree and the one I created to test this. If you'd prefer, you can send that information only to me by clicking Reply privately to author on this message.

Cheers,
Josh, AdWords API Team

HK

unread,
Jul 6, 2015, 2:30:53 PM7/6/15
to adwor...@googlegroups.com, hrav...@hotmail.com
For the record, the requested details have been sent to Josh on a private thread.

Giles Bodger

unread,
Jul 6, 2015, 4:29:35 PM7/6/15
to hrav...@hotmail.com, adwords-api
Hi Hans

no worries - we have resolved our issues with josh's help so please carry on with your questioning

cheers

Giles

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/g_T84xaUub8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/8a7ac579-bc3c-4342-8e63-de7042a76517%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages