Matching function in ad customizer is not working

85 views
Skip to first unread message

Kainesh Patel

unread,
Dec 21, 2015, 6:39:40 AM12/21/15
to AdWords API Forum, Praveen Sheetalnath, Kunal Parekh, Himanshu Agarwal
Hi,

I want to try ad customizer. I created feed and added 2 feedItems. One feedItem has Name as ITC and another Name as HUL. Now, I am mapping campaign to feed with matching function as EQUALS(FeedAttribute[32350825,1],"HUL"). Then I created a new ad with headline as 'headline{=MyFrstFeed556.Name}'

I was anticipating one ad with headline 'headlineHUL' but its generating two ads with both HUL and ITC.

I am attaching sample code(with changed credentials. The campaignId, adGroupId and accountId is not changed.), output of code, snapshot of feed and snapshot of two ads.

I have tried matching function with EQUALS, CONTAINS_ANY , but it didn't help. Can you check why matching function is not working?
Am I passing wrong matching function?

Also, I would like to know how to check and update matching function on UI.

Thanks,
Kainesh
output.txt
code.txt
feed_item_snapshot.png
ad1_snapshot.png
ad2_snapshot.png

Yin Niu

unread,
Dec 21, 2015, 3:27:41 PM12/21/15
to AdWords API Forum, prav...@sokrati.com, ku...@sokrati.com, himanshu...@sokrati.com
Hi Kainesh,

When you match by feed attribute, you should use the [feedId, feedAttributeId] as lhsOperand. It seems that you have used feedItemAttributeId as feedAttributeId in the matching function. 

Thanks,
Yin, AdWords API Team. 

Kainesh Patel

unread,
Dec 21, 2015, 3:43:39 PM12/21/15
to AdWords API Forum

Hi Yin,

I have used feed Attribute Id only which in my case is 1, which I got it before populating the feed items. If I am not wrong, there is no concept of feedItemAttribute Id, please correct me if I am wrong.

Thanks,
Kainesh

Yin Niu

unread,
Dec 21, 2015, 3:56:44 PM12/21/15
to AdWords API Forum
Hi Kainesh, 

Please take a look at this code example. You are hard-coding the feedAttributeIds. That might be the problem.

Kainesh Patel

unread,
Dec 21, 2015, 4:09:50 PM12/21/15
to AdWords API Forum
Hi Yin,

Thanks for your quick reply.

The matching function used in the code doesn't use either feedId or feedAttribute Id. It used FEED_ITEM_ID.
String matchingFunctionString = String.format(
"AND( IN(FEED_ITEM_ID, {%s}), EQUALS(CONTEXT.DEVICE, 'Mobile') )",
Joiner.on(',').join(siteLinksData.siteLinkFeedItemIds)); I agree, I have hard code the values, but its not not problem, since I have printed actual value which matches the hard code values. Can you try some combinations at your end? Also my second part of query is how to check matching function on UI, which is still unanswered? Thanks, Kainesh

Yin Niu

unread,
Dec 21, 2015, 4:29:16 PM12/21/15
to AdWords API Forum
Hi Kanesh, 

Could you send the output for the following code? 

System.out.printf("Feed with name '%s' and ID %d with nameAttributeId %s %d"
          + " and priceAttributeId %s %d and dateAttributeId %s %d and inventoryId %s %d"
          + " was created.\n",
          savedFeed.getName(),
          savedFeed.getId(),
          savedAttributes[0].getName(),
          savedAttributes[0].getId(),
          savedAttributes[1].getName(),
          savedAttributes[1].getId(),
          savedAttributes[2].getName(),
          savedAttributes[2].getId(),
          savedAttributes[3].getName(), 
savedAttributes[3].getId());

What is the attribute name for the attribute with id=1? 

In your query "EQUALS(FeedAttribute[" + feedId + ",1],\"HUL\")", you used feedAttributeId=1. That will be the attribute that it's matching against. 

You could also send me the SOAP request and response if the above check doesn't help you. 

To answer your second question, you won't be able to checking feed matching functions in UI. 

Kainesh Patel

unread,
Dec 21, 2015, 4:33:27 PM12/21/15
to AdWords API Forum, Kunal Parekh, Praveen Sheetalnath, Himanshu Agarwal
Hi,

Thanks for the quick response.

The output is been shared with you in output.txt.
The output is Feed with name 'MyFirstFeed556' and ID 32350825 with nameAttributeId Name 1 and priceAttributeId Price 2 and dateAttributeId Date 3 and inventoryId inventory 4 was created.

So, 1 corresponds to Name in Feed.

Thanks,
Kainesh

Kainesh Patel

unread,
Dec 21, 2015, 5:10:22 PM12/21/15
to AdWords API Forum, ku...@sokrati.com, prav...@sokrati.com, himanshu...@sokrati.com
Hi Yin,

Any update or progress, you would like to share with me?

Thanks,
Kainesh

Yin Niu

unread,
Dec 21, 2015, 5:19:34 PM12/21/15
to AdWords API Forum
Hi Kanesh,

Could you please send SOAP request and response log for further analysis?

In the meantime, you could try to match by FeedItemId.

Kainesh Patel

unread,
Dec 21, 2015, 5:52:39 PM12/21/15
to AdWords API Forum
Hi,

I have changed my matching function to IN(FEED_ITEM_ID, {2807134218}), where 2807134218 is FEED_ITEM_ID. But its not helping. Unable to capture soap request and response from the Java code. WIll uodate you, once I have it.

Thanks,
Kainesh

Kainesh Patel

unread,
Dec 21, 2015, 6:18:23 PM12/21/15
to AdWords API Forum
Hi Yin,

I am unable to capture soap request and response. Can you try the code in your setup?

Thanks,
Kainesh

Josh Radcliff (AdWords API Team)

unread,
Dec 22, 2015, 10:33:42 AM12/22/15
to AdWords API Forum
Hi Kainesh,

Ad customizers are a bit different from feed-based extensions. For customizers, you don't want to set up CustomerFeed/CampaignFeed/AdGroupFeed objects with matching functions. Instead, you should set the campaignTargetingadGroupTargetingkeywordTargeting, or geoTargeting attributes of the FeedItems as described in the Ad Customizers Guide.

Thanks,
Josh, AdWords API Team

Kainesh Patel

unread,
Dec 22, 2015, 10:41:39 AM12/22/15
to adwordsapia...@google.com, Praveen Sheetalnath, Kunal Parekh, Himanshu Agarwal, AdWords API Forum
Hi Josh,

By any chance, can we set using matching function?

The issue is loop is getting generated:-
1. Create Campaign- >Adgroup
2. Then I need to attach adGroup to feedItem(ad customizer).
3. Then I need to create ad.

If I merge step 1 and 3, then there would be chances of wrong ad be shown. For e.g Ad headline would be Get % discount instead of Get 20 % discount, since the feed was empty at that moment.

Also, I cannot create feedItem in step 1 since adGroup Id is not there.

Any alternative method?

Thanks,
Kainesh

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/h0ytp4gfXik/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
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/0090be3e-9834-461f-8924-456a95caece7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Josh Radcliff (AdWords API Team)

unread,
Dec 22, 2015, 10:48:59 AM12/22/15
to AdWords API Forum, adwordsapia...@google.com, prav...@sokrati.com, ku...@sokrati.com, himanshu...@sokrati.com
Hi Kainesh,

One thing to keep in mind with ad customizers is that you must have at least one ad in the ad group that does not use customizers (see the note at the end of the Setting up an ad section of the guide), so if you create the ads before the feed items are available, the ad without customizer references will serve.

Another idea is to create (ADD) your campaigns or ad groups with an initial status of PAUSED. Once you've completed the entire process and everything is in place, you can update the status to ENABLED.

Thanks,
Josh, AdWords API Team


On Tuesday, December 22, 2015 at 10:41:39 AM UTC-5, Kainesh Patel wrote:
Hi Josh,

By any chance, can we set using matching function?

The issue is loop is getting generated:-
1. Create Campaign- >Adgroup
2. Then I need to attach adGroup to feedItem(ad customizer).
3. Then I need to create ad.

If I merge step 1 and 3, then there would be chances of wrong ad be shown. For e.g Ad headline would be Get % discount instead of Get 20 % discount, since the feed was empty at that moment.

Also, I cannot create feedItem in step 1 since adGroup Id is not there.

Any alternative method?

Thanks,
Kainesh

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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/h0ytp4gfXik/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api+unsubscribe@googlegroups.com.

Kainesh Patel

unread,
Dec 22, 2015, 11:00:26 AM12/22/15
to adwordsapia...@google.com, AdWords API Forum, Praveen Sheetalnath, Kunal Parekh, Himanshu Agarwal
Hi Josh,

Got it. 

Query 1: Lets have I have feed with 3 feedItems and none of targeting is set. I have attached feed with campaign which has multiple adgroups. Each adgroup has a customizable ad and default ad. Since, targeting is set as none at feed item level, my query is that only default(non customizable ad) will be shown or all the feedItems would be eligible for replacement?

My second query is:- There are both customizable ad  and default ad in adGroup. The feed has feedItem which has proper adGroup targeting setted. Will both customizable and default ad will be shown, or only customizable ad will be shown?

Thanks,
Kainesh




On Tue, Dec 22, 2015 at 9:18 PM, Josh Radcliff (AdWords API Team) <adwordsapia...@google.com> wrote:
Hi Kainesh,

One thing to keep in mind with ad customizers is that you must have at least one ad in the ad group that does not use customizers (see the note at the end of the Setting up an ad section of the guide), so if you create the ads before the feed items are available, the ad without customizer references will serve.

Another idea is to create (ADD) your campaigns or ad groups with an initial status of PAUSED. Once you've completed the entire process and everything is in place, you can update the status to ENABLED.

Thanks,
Josh, AdWords API Team


On Tuesday, December 22, 2015 at 10:41:39 AM UTC-5, Kainesh Patel wrote:
Hi Josh,

By any chance, can we set using matching function?

The issue is loop is getting generated:-
1. Create Campaign- >Adgroup
2. Then I need to attach adGroup to feedItem(ad customizer).
3. Then I need to create ad.

If I merge step 1 and 3, then there would be chances of wrong ad be shown. For e.g Ad headline would be Get % discount instead of Get 20 % discount, since the feed was empty at that moment.

Also, I cannot create feedItem in step 1 since adGroup Id is not there.

Any alternative method?

Thanks,
Kainesh

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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/h0ytp4gfXik/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to

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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/h0ytp4gfXik/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.

Josh Radcliff (AdWords API Team)

unread,
Dec 22, 2015, 11:40:31 AM12/22/15
to AdWords API Forum, adwordsapia...@google.com, prav...@sokrati.com, ku...@sokrati.com, himanshu...@sokrati.com
Hi Kainesh,

First, I should correct my previous answer (sorry). You will not create CampaignFeeds or AdGroupFeeds for ad customizers. However, you must create a CustomerFeed in order to enable customizers for your account -- see the second code block in this section of the guide.

Now to your questions:

Query 1: Since none of your FeedItems have any of the targeting fields set, only the default ad will serve.

Query 2: Both ads will be shown. AdWords will rotate between the two.

Hope that helps!

Best regards,
Josh, AdWords API Team


On Tuesday, December 22, 2015 at 11:00:26 AM UTC-5, Kainesh Patel wrote:
Hi Josh,

Got it. 

Query 1: Lets have I have feed with 3 feedItems and none of targeting is set. I have attached feed with campaign which has multiple adgroups. Each adgroup has a customizable ad and default ad. Since, targeting is set as none at feed item level, my query is that only default(non customizable ad) will be shown or all the feedItems would be eligible for replacement?

My second query is:- There are both customizable ad  and default ad in adGroup. The feed has feedItem which has proper adGroup targeting setted. Will both customizable and default ad will be shown, or only customizable ad will be shown?

Thanks,
Kainesh



On Tue, Dec 22, 2015 at 9:18 PM, Josh Radcliff (AdWords API Team) <adwordsapiadvisor+josh@google.com> wrote:
Hi Kainesh,

One thing to keep in mind with ad customizers is that you must have at least one ad in the ad group that does not use customizers (see the note at the end of the Setting up an ad section of the guide), so if you create the ads before the feed items are available, the ad without customizer references will serve.

Another idea is to create (ADD) your campaigns or ad groups with an initial status of PAUSED. Once you've completed the entire process and everything is in place, you can update the status to ENABLED.

Thanks,
Josh, AdWords API Team


On Tuesday, December 22, 2015 at 10:41:39 AM UTC-5, Kainesh Patel wrote:
Hi Josh,

By any chance, can we set using matching function?

The issue is loop is getting generated:-
1. Create Campaign- >Adgroup
2. Then I need to attach adGroup to feedItem(ad customizer).
3. Then I need to create ad.

If I merge step 1 and 3, then there would be chances of wrong ad be shown. For e.g Ad headline would be Get % discount instead of Get 20 % discount, since the feed was empty at that moment.

Also, I cannot create feedItem in step 1 since adGroup Id is not there.

Any alternative method?

Thanks,
Kainesh

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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/h0ytp4gfXik/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api+unsubscribe@googlegroups.com.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to

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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/h0ytp4gfXik/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api+unsubscribe@googlegroups.com.

Kainesh Patel

unread,
Dec 22, 2015, 12:02:19 PM12/22/15
to Josh Radcliff, AdWords API Forum, Praveen Sheetalnath, Kunal Parekh, Himanshu Agarwal
Thanks Josh for the quick resolution. 


Josh, AdWords API Team
Josh, AdWords API Team

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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/h0ytp4gfXik/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to

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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/h0ytp4gfXik/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to

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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/h0ytp4gfXik/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages