How to Generate userInterest Resource Name using Google Ads API bita version ?

230 views
Skip to first unread message

Rakesh Chauhan

unread,
Nov 15, 2019, 11:32:18 PM11/15/19
to AdWords API and Google Ads API Forum
Hello sir ,

              i am trying to create userInterest but i can't create userInterest Resource Name because i can't get UserInterestOperation and all that 
              so can you please tell me how create UserInterest Resource Name using Google Ads API Bita version ?

Thank you 
  

Google Ads API Forum Advisor Prod

unread,
Nov 18, 2019, 3:57:00 PM11/18/19
to addon....@gmail.com, adwor...@googlegroups.com
Hi Rakesh,

When using the AdGroupCriteriaService to create a user interest, you will need to create a UserInterestInfo with the ID of the user interest you want to be targeted. 

Regards,
Anthony
Google Ads API Team

ref:_00D1U1174p._5001UOCINy:ref

Rakesh Chauhan

unread,
Nov 19, 2019, 5:20:04 AM11/19/19
to AdWords API and Google Ads API Forum
yes sir , but UserInterestInfo need UserInterest resource name , and i dont know how to create UserInterest Resource Name , because there is not Operation or MutateResponse for UserInterest then how can i get UserInterest Resource Name 

can you please help me ? 

Google Ads API Forum Advisor Prod

unread,
Nov 19, 2019, 3:50:18 PM11/19/19
to addon....@gmail.com, adwor...@googlegroups.com

Hi Rakesh,

You could use the format customers/[customer_id]/userInterests/[userInterestId].

Let me know if you face any issues.

Cheers,


Anthony
Google Ads API Team



ref:_00D1U1174p._5001UOCINy:ref

Rakesh Chauhan

unread,
Nov 19, 2019, 11:45:27 PM11/19/19
to AdWords API and Google Ads API Forum
Yes sir , i want to generate it , but i don't know how to generate it 

Google Ads API Forum Advisor Prod

unread,
Nov 20, 2019, 3:21:06 PM11/20/19
to addon....@gmail.com, adwor...@googlegroups.com
Hi Rakesh,

You can create a builder just like when creating other criteria. For the user interest, you can pass the ID of the category you need. Here is an example on how to add criteria using our Java client library.

Regards,

Rakesh Chauhan

unread,
Nov 21, 2019, 1:39:18 AM11/21/19
to AdWords API and Google Ads API Forum
yes , i have also tried like using i have also created multiple Language setup and Location setup , it has done perfectly 

but in   UserInterest Class i can not find format method , which by using it i can create Resource Name 

so can you please help me , i am very confused how to finish it .

Google Ads API Forum Advisor Prod

unread,
Nov 21, 2019, 3:52:19 PM11/21/19
to addon....@gmail.com, adwor...@googlegroups.com
Hi Rakesh,

Here is an example of a builder you can use to create the user interest:
CampaignCriterion.newBuilder()
.setCampaign(StringValue.of(campaignResourceName))
.setUserInterest(UserInterestInfo.newBuilder().setUserInterestCategory(StringValue.of("customers/123456789/userInterests/92949")).build())
.build();

Rakesh Chauhan

unread,
Nov 23, 2019, 1:33:16 AM11/23/19
to AdWords API and Google Ads API Forum
Yes , i was tried it 

CampaignCriterion.newBuilder()
.setCampaign(StringValue.of(campaignResourceName))
.setUserInterest(UserInterestInfo.newBuilder().setUserInterestCategory(StringValue.of("customers/123456789/userInterests/92949")).build())
.build();


but in this  i need UserInterest ResourceName 
it is StringValue.of("customers/123456789/userInterests/92949")

So how can i generate it ?

can i create it Sting as menually ?

Rakesh Chauhan

unread,
Nov 23, 2019, 4:20:12 AM11/23/19
to AdWords API and Google Ads API Forum
Thank you ... i have done it 😂️😂️😂️😂️😂️😂️


On Friday, November 22, 2019 at 2:22:19 AM UTC+5:30, adsapiforumadvisor wrote:
Reply all
Reply to author
Forward
0 new messages