Comments (4)
Instead of setting null, you should set an empty list, like new UrlList(new
String[] {}), good luck!
On Tue, May 12, 2015 at 3:17 PM, mmATX [email protected] wrote:
Hey guys -
I'm trying to set a tracking template and finalURL on a keyword. I
explicitly set 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
SET
21999324732
142938960012
http://www.myhotel.com/chicago/promoCode={_promoCode}?kwid={_kwid}
http://tracking.deepsearch.adlucent.com/adlucent/Redirector?kwid={_kwid}&adid={creative}&device={device}&retailer=delventosdoodles&url={lpurl}
kwid
217ad6637be843f3810916685e2e82c7
promoCode
chi55893
season
Fall_getaway
/soapenv:BodyAnd the response:
soap:Header
000515869d2114280ab612c5320067a4
AdGroupCriterionService
mutate
1
101
/soap:Header
soap:Body
<ListReturnValue.Type>AdGroupCriterionReturnValue</ListReturnValue.Type>
<AdGroupCriterion.Type>AdGroupCriterion</AdGroupCriterion.Type>
operations[0].operand.finalMobileUrls.urls[0]
UrlError.MISSING_PROTOCOL
<ApiError.Type>UrlError</ApiError.Type>
MISSING_PROTOCOL
/soap:BodyI then tried every variant I could come up with of setting the urlList to
null, new UrlList(new String[]), & new UrlList(null), etc & regardless of
what I tried, the soap message contains the same url chunk:<finalUrls> <urls/> </finalUrls>
& they all return UrlError.MISSING_PROTOCOL
Not surprisingly, it happens for both finalUrls and finalMobileUrls
-mm
—
Reply to this email directly or view it on GitHub
#45.
from googleads-java-lib.
Sorry, I wasn't clear enough. I have tried:
bagc.setFinalMobileUrls(new UrlList(new String[]{}));
and out of desperation:
UrlList ul = new UrlList();
ul.setUrls(new String[0]);
bagc.setFinalMobileUrls(ul);
UrlList ul = new UrlList();
ul.setUrls(null);
bagc.setFinalMobileUrls(ul);
and receive UrlError.MISSING_PROTOCOL for all
from googleads-java-lib.
Hi,
I just verified that the following approach successfully clears finalMobileUrls for a keyword:
// Create ad group criterion with updated bid.
Criterion criterion = new Criterion();
criterion.setId(keywordId);
BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion();
biddableAdGroupCriterion.setAdGroupId(adGroupId);
biddableAdGroupCriterion.setCriterion(criterion);
// Simply create a new UrlList. No need to set its urls.
biddableAdGroupCriterion.setFinalMobileUrls(new UrlList());
This produced the following operations XML (which succeeded):
<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>19067540234</adGroupId>
<criterion>
<id>10159180</id>
</criterion>
<finalMobileUrls/>
</operand>
</operations>
</mutate>
Could you give that approach a try?
Thanks
from googleads-java-lib.
Yes - that is giving me the right xml. Thanks a bunch!
from googleads-java-lib.
Related Issues (20)
- Query regarding setting keywordMinActivationBid and KewyordBid HOT 1
- Issue HOT 1
- 'java.lang.NoClassDefFoundError: com/google/protobuf/ServiceException' HOT 2
- Migrate away from apache-axis possibly to axis-2 HOT 1
- EntityLimitReachedError.ENTITY_LIMIT_REACHED | Do I need a new Sandbox? HOT 1
- Gellallorder.java under the package orderservice returnging 404 not found error HOT 1
- Not able to get v12 resources/services with latest maven dependency HOT 3
- javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
- Default branch is now `main` HOT 2
- io.grpc.NameResolver$Args$Builder.setOverrideAuthority(Ljava/lang/String;)Lio/grpc/NameResolver$Args$Builder; HOT 1
- Invalid element in com.google.api.ads.admanager.axis.v202211.ReportQuery - timeZoneType HOT 5
- Replacing dfp-axis with dfp-appengine: Exception Class isn't Throwable HOT 1
- > ![C](https://user-images.githubusercontent.com/50383553/64349736-ade46480-cfb4-11e9-8cd2-7e893cdd16e8.PNG)
- Licencia
- Licencia/apache
- Licencia-mit
- Security vulnerability issue for GAM API version 5.1.0
- Goggle Ads API v14-java.lang.NoSuchMethodError: com.google.api.client.util.escape.PercentEscaper.<init>(Ljava/lang/String;)V HOT 2
- Apache Axis Should Be Replaced by Axis 2 Due to Multiple CVEs and EOL HOT 2
- Enable keepAlive at Socket level
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googleads-java-lib.