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>
<operations>
<operator>SET</operator>
<adGroupId>21999324732</adGroupId>
<criterion>
<id>142938960012</id>
</criterion>
<destinationUrl/>
<finalUrls>
</finalUrls>
<finalMobileUrls>
<urls/>
</finalMobileUrls>
<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>
<requestId>000515869d2114280ab612c5320067a4</requestId>
<serviceName>AdGroupCriterionService</serviceName>
<methodName>mutate</methodName>
<operations>1</operations>
<responseTime>101</responseTime>
</ResponseHeader>
</soap:Header>
<soap:Body>
<rval>
<ListReturnValue.Type>AdGroupCriterionReturnValue</ListReturnValue.Type>
<value>
<AdGroupCriterion.Type>AdGroupCriterion</AdGroupCriterion.Type>
</value>
<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