Re: Targeting In Google Ads Api

2022-02-21 Thread Ramesh Kolamala
Sure, will do that. Thanks.

On Mon, Feb 21, 2022 at 2:48 PM Google Ads API Forum Advisor
 wrote:

> HI Ramesh,
>
> I've responded to you on this thread
> .
> Moving forward, kindly refrain from posting the same concern on multiple
> thread for better tracking of the issues.
>
> Regards,
> [image: Google Logo]
> Teejay Wennie
> Google Ads API Team
>
>
> ref:_00D1U1174p._5004Q2WxJEs:ref
>


-- 
Thanks & Regards

K Ramesh
Zend Certified Engineer - PHP 5 & Zend Framework
+91 9989664863

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/CAHkFBoVgJFNYVJHQBh1J4W%2BO6D97%3DKzT5hp-23rQ4_pmeLjuCQ%40mail.gmail.com.


Re: Targeting In Google Ads Api

2022-02-19 Thread Ramesh Kolamala
'negative' => false is also giving the same error.

On Saturday, February 19, 2022 at 7:05:29 PM UTC+5:30 Ramesh Kolamala wrote:

>
> Hi Luis,
>
> The above code results in exclusion of topic, so I removed 'negative' = 
> true and tried but getting the error, below is my code and error:
>
> *My Code:*
> $topicId = 317;
> 
> $campaignCriterion = new CampaignCriterion([
> 'topic' => new TopicInfo([
> 'topic_constant' => ResourceNames::forTopicConstant($topicId)
> ]),
> 'campaign' => $campaignResourceName
> ]);
>
> $operations[] = new CampaignCriterionOperation(['create' => 
> $campaignCriterion]);
> *Error:*
> "errorCode": { "criterionError": 
> "FIELD_INCOMPATIBLE_WITH_NEGATIVE_TARGETING" }, "message": "The field is 
> not allowed to be set when the negative field is set to true, e.g. we don't 
> allow bids in negative ad group or campaign criteria.", "location": { 
> "fieldPathElements": [ { "fieldName": "operations", "index": 0 }, { 
> "fieldName": "create" }, { "fieldName": "topic" } ] }
>
> Can you suggest me.
>
> On Tuesday, March 19, 2019 at 11:42:43 AM UTC+5:30 
> googleadsapi...@google.com wrote:
>
>> 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=xx, 
>> x-goog-api-client=gl-java/1.8.0_171-google-v7 gapic/ gax/1.35.0 grpc/1.16.1}
>> Body: customer_id: "xx"
>> 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=xx, 
>> x-goog-api-client=gl-java/1.8.0_171-google-v7 gapic/ gax/1.35.0 grpc/1.16.1}
>> Body: customer_id: "xx"
>> 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
>>
>>
>> Was your question answered? Please rate your experience with us by taking 
>> a short survey.
>> If not -- reply to this email and tell us what else we can do to help.
>>
>> Take Survey 
>> <https://support.google.com/google-ads/contact/survey_transactional?caseid=3-332425726=en=1>
>>
>> Also find us on our blog and discussion group:
>> http://googleadsdeveloper.blogspot.com/search/label/adwords_api
>> https://developers.google.com/adwords/api/community/
>> On 03/19/19 05:50:39 krishnaki...@gmail.com 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 th

Re: Targeting In Google Ads Api

2022-02-19 Thread Ramesh Kolamala

Hi Luis,

The above code results in exclusion of topic, so I removed 'negative' = 
true and tried but getting the error, below is my code and error:

*My Code:*
$topicId = 317;

$campaignCriterion = new CampaignCriterion([
'topic' => new TopicInfo([
'topic_constant' => ResourceNames::forTopicConstant($topicId)
]),
'campaign' => $campaignResourceName
]);

$operations[] = new CampaignCriterionOperation(['create' => 
$campaignCriterion]);
*Error:*
"errorCode": { "criterionError": 
"FIELD_INCOMPATIBLE_WITH_NEGATIVE_TARGETING" }, "message": "The field is 
not allowed to be set when the negative field is set to true, e.g. we don't 
allow bids in negative ad group or campaign criteria.", "location": { 
"fieldPathElements": [ { "fieldName": "operations", "index": 0 }, { 
"fieldName": "create" }, { "fieldName": "topic" } ] }

Can you suggest me.

On Tuesday, March 19, 2019 at 11:42:43 AM UTC+5:30 
googleadsapi...@google.com wrote:

> 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 
> 
>  in 
> targeting the location. For UserInterestInfo and TopicInfo, you may refer 
> below for sample request body. Also, you may refer to this link 
> 
>  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=xx, 
> x-goog-api-client=gl-java/1.8.0_171-google-v7 gapic/ gax/1.35.0 grpc/1.16.1}
> Body: customer_id: "xx"
> 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=xx, 
> x-goog-api-client=gl-java/1.8.0_171-google-v7 gapic/ gax/1.35.0 grpc/1.16.1}
> Body: customer_id: "xx"
> 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
>
>
> Was your question answered? Please rate your experience with us by taking 
> a short survey.
> If not -- reply to this email and tell us what else we can do to help.
>
> Take Survey 
> 
>
> Also find us on our blog and discussion group:
> http://googleadsdeveloper.blogspot.com/search/label/adwords_api
> https://developers.google.com/adwords/api/community/
> On 03/19/19 05:50:39 krishnaki...@gmail.com 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 adwor...@googlegroups.com
> To unsubscribe from this group, send email to
> adwords-api+unsubscr...@googlegroups.com
> For more options, visit this group 

TopicInfo positive target criteria is giving the error

2022-02-19 Thread Ramesh Kolamala
I am trying to target a Topic at campaign level, but getting the following 
error:

*My Code:*
$topicId = 317;

$campaignCriterion = new CampaignCriterion([
'topic' => new TopicInfo([
'topic_constant' => ResourceNames::forTopicConstant($topicId)
]),
'campaign' => $campaignResourceName
]);

$operations[] = new CampaignCriterionOperation(['create' => 
$campaignCriterion]);
*Error:*
"errorCode": { "criterionError": 
"FIELD_INCOMPATIBLE_WITH_NEGATIVE_TARGETING" }, "message": "The field is 
not allowed to be set when the negative field is set to true, e.g. we don't 
allow bids in negative ad group or campaign criteria.", "location": { 
"fieldPathElements": [ { "fieldName": "operations", "index": 0 }, { 
"fieldName": "create" }, { "fieldName": "topic" } ] }

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/6084e3fe-6a2a-4943-ae49-7d094d113153n%40googlegroups.com.