Just to follow up, it turns out the correct usage is: bagc.setFinalMobileUrls(new UrlList());
On Tuesday, May 12, 2015 at 8:40:10 AM UTC-5, Michael Cloonan (AdWords API Team) wrote: > > Hello, > > After a little testing with another client library, I believe the format > the XML should take to "un-set" this field is: > > <finalUrls/> > > This may be a bug with the Java client library. Please file a bug at their > issue > tracker <https://github.com/googleads/googleads-java-lib/issues> with > details about what you've tried so far. > > Regards, > Mike, AdWords API Team > > On Monday, May 11, 2015 at 6:50:43 PM UTC-4, mm wrote: >> >> Alas, that doesn't work, either, Michael. I tried every permutation I >> could come up with: >> bagc.setFinalMobileUrls(null); >> >> bagc.setFinalMobileUrls(new UrlList()); >> >> bagc.setFinalMobileUrls(new UrlList(null)); >> >> bagc.setFinalMobileUrls(new UrlList()); >> bagc.getFinalMobileUrls().setUrls(null); >> >> bagc.setFinalMobileUrls(new UrlList(new String[])); >> >> >> Regardless of which of these I tried, the soap message contains the same >> url chunk: >> <finalUrls> >> <urls/> >> </finalUrls> >> >> so they all return UrlError.MISSING_PROTOCOL >> >> And, not surprisingly, it happens for both finalUrls and finalMobileUrls >> >> -mm >> >> >> On Monday, May 11, 2015 at 10:02:23 AM UTC-5, mm wrote: >>> >>> Ah -duh! - don't know why I didn't try that... Thanks, Michael! >>> >>> On Friday, May 8, 2015 at 12:02:55 PM UTC-5, Michael Cloonan (AdWords >>> API Team) wrote: >>>> >>>> Hello, >>>> >>>> I believe that you need a UrlList with no URLs, rather than setting to >>>> null directly. >>>> >>>> Try changing this line: >>>> bagc.setFinalMobileUrls(null); >>>> >>>> To this: >>>> bagc.setFinalMobileUrls(new UrlList(new String[])); >>>> >>>> If this still fails, let me know and I can look into it further. >>>> >>>> Regards, >>>> Mike, AdWords API Team >>>> >>>> On Thursday, May 7, 2015 at 8:08:07 PM UTC-4, mm wrote: >>>>> >>>>> Hey guys - >>>>> I'm trying to set a tracking template and finalURL on a keyword. I am >>>>> explicitly setting the finalMobileUrls to null, yet when I attempt the >>>>> update, I get the UrlError.MISSING_PROTOCOL for the non-existent mobile >>>>> url. This is using the v201502 java client (googleads-java-lib-v1.38.0, >>>>> specifically). >>>>> >>>>> The code: >>>>> >>>>> Criterion keyword = new Criterion(); >>>>> keyword.setId( Long.parseLong( k.getId().getKeywordId() ) >>>>> ); >>>>> >>>>> BiddableAdGroupCriterion bagc = new >>>>> BiddableAdGroupCriterion(); >>>>> bagc.setAdGroupId( Long.parseLong( >>>>> k.getId().getAdGroupId()) ); >>>>> bagc.setCriterion( keyword ); >>>>> //If there used to be a destURL value, an empty string >>>>> tells adwords to get rid of it >>>>> bagc.setDestinationUrl(""); >>>>> >>>>> bagc.setTrackingUrlTemplate(k.getTrackingTemplate()==null?"":k.getTrackingTemplate()); >>>>> if (k.getFinalURL()==null) { >>>>> bagc.setFinalUrls(null); >>>>> } else { >>>>> bagc.setFinalUrls(new UrlList(new >>>>> String[]{k.getFinalURL()})); >>>>> } >>>>> if (k.getFinalMobileURL()==null) { >>>>> bagc.setFinalMobileUrls(null); >>>>> } else { >>>>> bagc.setFinalMobileUrls(new UrlList(new >>>>> String[]{k.getFinalMobileURL()})); >>>>> } >>>>> >>>>> And the resulting soap request: >>>>> >>>>> <soapenv:Body> >>>>> <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201502"> >>>>> <operations> >>>>> <operator>SET</operator> >>>>> <operand xmlns:ns2=" >>>>> https://adwords.google.com/api/adwords/cm/v201502" >>>>> xsi:type="ns2:BiddableAdGroupCriterion"> >>>>> <adGroupId>21999324732</adGroupId> >>>>> <criterion> >>>>> <id>142938960012</id> >>>>> </criterion> >>>>> <destinationUrl/> >>>>> <finalUrls> >>>>> <urls> >>>>> http://www.myhotel.com/chicago/promoCode={_promoCode}?kwid={_kwid} >>>>> </urls> >>>>> </finalUrls> >>>>> <finalMobileUrls> >>>>> <urls/> >>>>> </finalMobileUrls> >>>>> <trackingUrlTemplate> >>>>> http://tracking.deepsearch.adlucent.com/adlucent/Redirector?kwid={_kwid}&adid={creative}&device={device}&retailer=delventosdoodles&url={lpurl} >>>>> </trackingUrlTemplate> >>>>> <urlCustomParameters> >>>>> <parameters> >>>>> <key>kwid</key> >>>>> <value>217ad6637be843f3810916685e2e82c7</value> >>>>> </parameters> >>>>> <parameters> >>>>> <key>promoCode</key> >>>>> <value>chi55893</value> >>>>> </parameters> >>>>> <parameters> >>>>> <key>season</key> >>>>> <value>Fall_getaway</value> >>>>> </parameters> >>>>> </urlCustomParameters> >>>>> </operand> >>>>> </operations> >>>>> </mutate> >>>>> </soapenv:Body> >>>>> >>>>> And the response: >>>>> <soap:Header> >>>>> <ResponseHeader xmlns=" >>>>> https://adwords.google.com/api/adwords/cm/v201502"> >>>>> <requestId>000515869d2114280ab612c5320067a4</requestId> >>>>> <serviceName>AdGroupCriterionService</serviceName> >>>>> <methodName>mutate</methodName> >>>>> <operations>1</operations> >>>>> <responseTime>101</responseTime> >>>>> </ResponseHeader> >>>>> </soap:Header> >>>>> <soap:Body> >>>>> <mutateResponse xmlns=" >>>>> https://adwords.google.com/api/adwords/cm/v201502"> >>>>> <rval> >>>>> >>>>> <ListReturnValue.Type>AdGroupCriterionReturnValue</ListReturnValue.Type> >>>>> <value> >>>>> >>>>> <AdGroupCriterion.Type>AdGroupCriterion</AdGroupCriterion.Type> >>>>> </value> >>>>> <partialFailureErrors xmlns:xsi=" >>>>> http://www.w3.org/2001/XMLSchema-instance" xsi:type="UrlError"> >>>>> >>>>> <fieldPath>operations[0].operand.finalMobileUrls.urls[0]</fieldPath> >>>>> <trigger/> >>>>> >>>>> <errorString>UrlError.MISSING_PROTOCOL</errorString> >>>>> <ApiError.Type>UrlError</ApiError.Type> >>>>> <reason>MISSING_PROTOCOL</reason> >>>>> </partialFailureErrors> >>>>> </rval> >>>>> </mutateResponse> >>>>> </soap:Body> >>>>> >>>>> Is there some other way I should be indicating that there are no >>>>> finalMobileUrls? >>>>> >>>>> Thanks - >>>>> mm >>>>> >>>> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/b30ae215-c685-4396-b6a1-8b6b77561ec7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
