Re: How do I filter on PlaceholderTypes in CampaignFeedService?

131 views
Skip to first unread message

Takeshi Hagikura (AdWords API Team)

unread,
Jun 6, 2013, 2:51:16 AM6/6/13
to adwor...@googlegroups.com
Hi, 

Looks like you can use EQUALS operator. 
I'll get back to you as for IN operator. 
(CONTAINS operator is targeted for String values. So it shouldn't be allowed)

Best,
- Takeshi

On Tuesday, June 4, 2013 12:10:42 AM UTC+9, magnus...@feedeo.com wrote:
Hi,

I'm trying to run a get call on the CampaignFeedService where I only get the feeds for site links.

I tried creating my selector like this (in Java):

        Selector selector = new Selector();

        selector.setFields(new String[] { "CampaignId", "FeedId", "MatchingFunction", "PlaceholderTypes", "Status" });

        Predicate idPredicate = new Predicate();
        idPredicate.setField("CampaignId");
        idPredicate.setOperator(PredicateOperator.IN);
        idPredicate.setValues(getIds(campaigns));

        Predicate typePredicate = new Predicate();
        typePredicate.setField("PlaceholderTypes");
        typePredicate.setOperator(PredicateOperator.CONTAINS);
        typePredicate.setValues(new String[] { String.valueOf(GooglePlaceholder.SITELINKS) });

        Predicate statusPredicate = new Predicate();
        statusPredicate.setField("Status");
        statusPredicate.setOperator(PredicateOperator.EQUALS);
        statusPredicate.setValues(new String[] { "ACTIVE" });

        selector.setPredicates(new Predicate[] { idPredicate, typePredicate, statusPredicate });

        return selector;


But when I run this I get the following error:

            <faultstring>[SelectorError.INVALID_PREDICATE_OPERATOR @ selector; trigger:'PlaceholderTypes']</faultstring>
            <detail>
                <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201302">
                    <message>[SelectorError.INVALID_PREDICATE_OPERATOR @ selector; trigger:'PlaceholderTypes']</message>
                    <ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SelectorError">
                        <fieldPath>selector</fieldPath>
                        <trigger>PlaceholderTypes</trigger>
                        <errorString>SelectorError.INVALID_PREDICATE_OPERATOR</errorString>
                        <ApiError.Type>SelectorError</ApiError.Type>
                        <reason>INVALID_PREDICATE_OPERATOR</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>

I also tried using IN as the operator for the placeholder types predicate but with the same result.

Am I going about this in the wrong way?

Thanks
Magnus Ljung

Peng Taug

unread,
May 21, 2014, 3:40:37 AM5/21/14
to adwor...@googlegroups.com
Is that means we can't filter multiple placeholder types with CampaignFeedService?

Ray Tsang (AdWords API Team)

unread,
Jul 9, 2014, 4:14:17 PM7/9/14
to adwor...@googlegroups.com
Peng,

Just to follow up, have you tried the IN operator

Thanks,

Ray

Giles Bodger

unread,
Jul 16, 2014, 10:09:11 AM7/16/14
to adwor...@googlegroups.com
I try this but get that the following error

Root reason: [SelectorError.INVALID_PREDICATE_FIELD_NAME @ selector; trigger:'placeholderTypes']

doesnt matter if i use IN or CONTAINS

Ray Tsang (AdWords API Team)

unread,
Jul 16, 2014, 3:13:22 PM7/16/14
to adwor...@googlegroups.com
Giles,

I'll look into this.

Thanks,

Ray

Ray Tsang (AdWords API Team)

unread,
Aug 20, 2014, 9:56:29 AM8/20/14
to adwor...@googlegroups.com
Peng,

Have you tried to use CONTAINS_ANY or CONTAINS_ALL predicates?  These should work as expected.  Which service were you trying to select from?

Thanks,

Ray
Reply all
Reply to author
Forward
0 new messages