Hi Martin,
When implementing criteria targeting via Google Ads API, all you need to do
is to specify the criteria resource_name like the example stated here
<https://developers.google.com/google-ads/api/docs/targeting/location-targeting#geo_target_campaigns_for_a_region>
in
targeting the location. For UserInterestInfo and TopicInfo, you may refer
below for sample request body. Also, you may refer to this link
<https://developers.google.com/google-ads/api/docs/samples/add-campaign-targeting-criteria#java>
for
complete sample code (also available in other languages that we support) on
how to add campaign targeting criteria as the implementation of adding the
other criteria is quite the same as this example.
Sample Request for TopicInfo
-------
MethodName:
google.ads.googleads.v1.services.CampaignCriterionService/MutateCampaignCriteria
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=xxxxxxxxxx,
x-goog-api-client=gl-java/1.8.0_171-google-v7 gapic/ gax/1.35.0 grpc/1.16.1}
Body: customer_id: "xxxxxxxxxx"
operations {
create {
campaign {
value: "customers/[customer_id]/campaigns/[campaign_id]"
}
negative {
value: true
}
topic {
topic_constant {
value: "topicConstants/958"
}
}
}
}
Sample Request for UserInterestId
-------
MethodName:
google.ads.googleads.v1.services.CampaignCriterionService/MutateCampaignCriteria
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=xxxxxxxxxx,
x-goog-api-client=gl-java/1.8.0_171-google-v7 gapic/ gax/1.35.0 grpc/1.16.1}
Body: customer_id: "xxxxxxxxxx"
operations {
create {
campaign {
value: "customers/[customer_id]/campaigns/[campaign_id]"
}
negative {
value: true
}
user_interest {
user_interest_category {
value: "customers/[customer_id]/userInterests/80412"
}
}
}
}
Thanks and regards,
Luis
Google Ads API Team
On 03/19/19 05:50:39 [email protected] wrote:
So I'm working on migrating from Adwords API to Ads api and I'm struck at
one point, that is Targeting service. I cannot actually Target an Adgroup
using the Ads API with either Topic or UserInterest as there are no
examples available in the client libraries. I know that we have to create
TopicInfo or UserInterestInfo for targeting. But how do we set the
targeting Id or user interest id to the TopicInfo or UserInterestInfo,
there are no setter methods for that.
val topicInfo =
TopicInfo.newBuilder().setTopicConstant(StringValue.of("958"))
.build()
val interestInfo: UserInterestInfo = UserInterestInfo
.newBuilder()
.setUserInterestCategory(StringValue.of("80412"))
.build()
Using the above topicInfo and InterestInfo, google Ads API is failing while
mutating with AdgroupCriterionServiceClient. Help me out.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/414e3fc3-8b92-4c64-b7f2-9e2c57f71f50%40googlegroups.com
<https://groups.google.com/d/msgid/adwords-api/414e3fc3-8b92-4c64-b7f2-9e2c57f71f50%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/18idu0o000000000gfgrb8002q60j8w6cmj6cpi6go30c1g68qjechm%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.