Hi,
I am trying to add campaign targets using java client library but getting
below error while adding device targets.I followed the approach mentioned
in Google Ads API examples
https://github.com/googleads/google-ads-java/blob/master/google-ads-examples/src/main/java/com/google/ads/googleads/examples/targeting/AddCampaignTargetingCriteria.java
Note that location and proximity targets are getting added successfully but
*device
targets returns error "OPERATOR_NOT_SUPPORTED_FOR_CRITERION_TYPE"*
*Is there bug in google Ads API while adding device targets, if yes any
timelines when it will be resolved or is there any problem in below
request.*
Request and Response are below:
Request
-------
MethodName:
google.ads.googleads.v2.services.CampaignCriterionService/MutateCampaignCriteria
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=TOKEN, login-customer-id=xxxxxxxxxx,
x-goog-api-client=gl-java/1.8.0_201 gapic/ gax/1.45.0 grpc/1.21.0}
Body: customer_id: "yyyyyyyyyy"
operations {
create {
campaign {
value: "customers/yyyyyyyyyy/campaigns/aaaaaaaaaa"
}
criterion_id {
value: 30001
}
negative {
}
device {
type: MOBILE
}
bid_modifier {
value: 4.5
}
}
}
operations {
create {
campaign {
value: "customers/yyyyyyyyyy/campaigns/aaaaaaaaaa"
}
negative {
}
bid_modifier {
value: 3.4
}
proximity {
geo_point {
longitude_in_micro_degrees {
value: -178337050
}
latitude_in_micro_degrees {
value: 28422800
}
}
radius {
value: 10.0
}
radius_units: KILOMETERS
}
}
}
operations {
create {
campaign {
value: "customers/yyyyyyyyyy/campaigns/aaaaaaaaaa"
}
criterion_id {
value: 21132
}
negative {
}
location {
geo_target_constant {
value: "geoTargetConstants/21132"
}
}
bid_modifier {
value: 2.3
}
}
}
operations {
create {
campaign {
value: "customers/yyyyyyyyyy/campaigns/aaaaaaaaaa"
}
criterion_id {
value: 21133
}
negative {
}
location {
geo_target_constant {
value: "geoTargetConstants/21133"
}
}
bid_modifier {
value: 1.2
}
}
}
partial_failure: true
Response
--------
Headers:
Metadata(content-disposition=attachment,content-type=application/grpc,request-id=7Cs-1xvq5XYUgPAj4vQ4jA,date=Fri,
30 Aug 2019 10:09:06 GMT,alt-svc=quic=":443"; ma=2592000; v="46,43,39")
Body: results {
}
results {
resource_name:
"customers/yyyyyyyyyy/campaignCriteria/aaaaaaaaaa~810693935922"
}
results {
resource_name: "customers/yyyyyyyyyy/campaignCriteria/aaaaaaaaaa~21132"
}
results {
resource_name: "customers/yyyyyyyyyy/campaignCriteria/aaaaaaaaaa~21133"
}
partial_failure_error {
code: 3
*message: "This operator cannot be applied to a criterion of this type.,
at operations[0].create.device"*
details {
type_url:
"type.googleapis.com/google.ads.googleads.v2.errors.GoogleAdsFailure"
value: "\nm\n\003\350\001\t\022<*This operator cannot be applied to a
criterion of this type*
.\032\002*\000\"$\022\016\n\noperations\022\000\022\b\n\006create\022\b\n\006device"
}
}
Failure message: null
Status: Status{code=OK, description=null, cause=null}.
2019-08-30 10:09:08,867 [main] INFO
c.t.s.c.g.i.s.CampaignTargetServiceClient - Add campaign targets operation
0 failed for account yyyyyyyyyy with errors: [error_code {
campaign_criterion_error: *OPERATOR_NOT_SUPPORTED_FOR_CRITERION_TYPE*
}
message: "This operator cannot be applied to a criterion of this type."
trigger {
string_value: ""
}
location {
field_path_elements {
field_name: "*operations*"
index {
}
}
field_path_elements {
field_name: "*create*"
}
field_path_elements {
field_name: "*device*"
}
}
]
Thanks,
Alok
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/51af38f6-dbce-4e2d-9ec5-26ea78e43052%40googlegroups.com.