FeedMapping service can't be queried with PlaceholderType and CriterionType in WHERE clause at the same time, but AdWords API can.

70 views
Skip to first unread message

Dongqi Wang

unread,
May 31, 2019, 11:55:21 AM5/31/19
to AdWords API and Google Ads API Forum
Hi,

When using AdWords API, I can get data with predicates like "PlaceholderTypeId == 10 AND CriterionTypeId != 61" to fetch Ad Customizer related FeedMappings, but I will get empty response when using such conditions to query against Google Ads API. Is it a bug?


Best,
Dongqi

Google Ads API Forum Advisor Prod

unread,
Jun 3, 2019, 1:59:55 AM6/3/19
to adwor...@googlegroups.com
Hi Dongqi,

Instead of using the digits as filters, could you use the enums as seem in this documentation when retrieving the PlaceholderType using the Google Ads API?

As for the CiterionTypeId, could you also use the enums as seen in the DsaPageFeedCriterionField documentation? Let me know if this helps.

Thanks and regards,
Peter
Google Ads API Team

ref:_00D1U1174p._5001UBkn2x:ref

Dongqi Wang

unread,
Jun 3, 2019, 11:41:44 AM6/3/19
to AdWords API and Google Ads API Forum
Hi,

Thanks for the reply. Sorry that I didn't make it clear. 

I'm saying that when using Google Ads API, I can't put PlaceholderType and CriterionType in WHERE clause at the same time, like 
" WHERE feed_mapping.criterion_type != 'DSA_PAGE_FEED' AND 
                 feed_mapping.placeholder_type = 'AD_CUSTOMIZER' ". 
I will get empty response if I do that. 

However, when using AdWords API, I'm able to put PlaceholderType and CriterionType in the Predicates at the same time, like 
" predicates = new []
                    {
                        new Predicate
                        {
                            field = FeedMapping.Fields.PlaceholderType.FieldName,
                            @operator = PredicateOperator.EQUALS,
                            operatorSpecified = true,
                            values = new []{"10"}
                        },
                        new Predicate
                        {
                            field = FeedMapping.Fields.CriterionType.FieldName,
                            @operator = PredicateOperator.NOT_EQUALS,
                            operatorSpecified = true,
                            values = new []{"61"}
                        }
                    } "


Best,
Dongqi

Google Ads API Forum Advisor Prod

unread,
Jun 3, 2019, 11:31:18 PM6/3/19
to adwor...@googlegroups.com
Hi Dongqi,
 
My apologies for the confusion. Could you provide your complete Google Ads API query so I can try and replicate the issue on my end? You may reply privately using the Reply privately to author option.

Dongqi Wang

unread,
Jul 1, 2019, 2:44:59 AM7/1/19
to AdWords API and Google Ads API Forum
Any update? Thanks!

Best,
Dongqi

Google Ads API Forum Advisor Prod

unread,
Jul 2, 2019, 6:15:44 PM7/2/19
to wangdon...@gmail.com, adwor...@googlegroups.com
Hi,

In the Google Ads API, the placeholder_type and criterion_type fields are union fields.

https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v2.resources#google.ads.googleads.v2.resources.FeedMapping

Therefore, a given instance of feed_mapping will have either placeholder_type or criterion_type, but not both. Therefore, the criteria of:


    feed_mapping.criterion_type != 'DSA_PAGE_FEED' AND
    feed_mapping.placeholder_type = 'AD_CUSTOMIZER'

will never be satisfied by an instance of feed_mapping. If instead you remove the first condition, you should only get back feed_mapping objects with placeholder_type = 'AD_CUSTOMIZER'.

Thanks,
Josh, Google Ads API Team

ref:_00D1U1174p._5001UBkn2x:ref

Dongqi Wang

unread,
Jul 9, 2019, 9:55:36 AM7/9/19
to AdWords API and Google Ads API Forum
Thanks for the details. 
One more question, is it possible that a Feed has two related FeedMappings at the same time, amogn which one is AD_CUSTOMIZER and another is DSA_PAGE_FEED? Thanks!

Best,
Dongqi

Google Ads API Forum Advisor Prod

unread,
Jul 10, 2019, 6:44:39 PM7/10/19
to wangdon...@gmail.com, adwor...@googlegroups.com
Hi Dongqi,

Technically, it is possible to create multiple FeedMapping objects for the same feed but with different placeholder types, but in practice it is highly unlikely. This would require having a single feed that contains attributes for two different placeholder types. This setup would be very difficult to maintain, since users would have to somehow know which attributes to fill in on a given FeedItem based on its intended placeholder type. In addition, this would require some very complex matching functions on CustomerFeed, CampaignFeed, or AdGroupFeed.
Reply all
Reply to author
Forward
0 new messages