Filter by custom criteria

1,229 views
Skip to first unread message

bki...@graphiq.com

unread,
Feb 22, 2017, 9:06:02 PM2/22/17
to Google's DoubleClick for Publishers API Forum
googleads==5.1.0
version='v201702'

Hello,

I am pulling data from the DFP API and would like to include a statement in the reportQuery that filters for values that contain '=example' (e.g. this would be the gist of it: 'where custom_criteria like '%=example%'). Having a bit of difficulty though. Coworker of mine tells me that in the past that functionality wasn't even possible (filtering by custom criteria). I wanted to ask if it is available, and if so, how to do it? Seems like it's possible here:


,but it doesn't specify if custom_criteria is a valid field.

(all done in Python, if you feel so inclined as to provide an example of how it'd look)

Cheers,

Brandon

Vincent Racaza (DFP API Team)

unread,
Feb 22, 2017, 11:02:47 PM2/22/17
to Google's DoubleClick for Publishers API Forum
Hi Brandon,

In the API reports, you can only filter by CUSTOM_TARGETING_VALUE_ID for the custom criteria. For example, the custom targeting key and value is "car=example", then you need to get first via CustomTargetingService the id of "example". And then, that id can now be used in your query filter:

         'WHERE CUSTOM_TARGETING_VALUE_ID = :123456'

Let me know if you have further questions.

Thanks,
Vincent Racaza, DFP API Team

fd

unread,
May 20, 2018, 9:40:42 AM5/20/18
to Google's DoubleClick for Publishers API Forum
Hi Vincent, 


Since it is not possible to filter for custom_criteria, I am trying to include a statement in the reportQuery that filters for  CUSTOM_TARGETING_VALUE_ID, as suggested in your clear answer. I would need to use IS NOT NULL command in my query. Is it possible? In PQL documentation (https://developers.google.com/doubleclick-publishers/docs/pqlreference) IS NULL seems to be possible only. Can you please confirm this? Can you also please confirm that it is not possible to use the command NOT LIKE in DFP queries? I am writing queries using NOT LIKE but they are giving me syntax errors. 

Thanks in advance. 

Fede

Vincent Racaza (DFP API Team)

unread,
May 21, 2018, 9:15:07 AM5/21/18
to Google's DoubleClick for Publishers API Forum
Hi Fede,

For the "IS NULL" operator, it is only supported for the other services such as the LineItemService, and not the ReportService. This said, you cannot use the IS NULL operator for the CUSTOM_TARGETING_VALUE_ID filter in your report. You need to use the IN operator instead if you have multiple custom targeting value IDs that you wish to filter.

For the "NOT LIKE" operator, this is also not supported in PQL for ReportService and other services. You can see the supported operators in our guide itself, and the "NOT LIKE" operator is not listed.

If you have other clarifications, kindly create a new forum thread so we can better track your concern.
Reply all
Reply to author
Forward
0 new messages