How to use advanced filters in Facebook Ads?
How to use advanced filters in Facebook Ads?
You can filter the data to be imported using Graph API syntax - [filter_1, filter_2, ... , filter_N].
For single filtering you can use a single filter ([filter_1]) - the structure, in this case, is as follows:
[ { "field":"adset.name", "operator":"CONTAIN", "value":"Blog" } ]
- field - means the field name that you want to apply the filter to
- operator - condition that you want to use in the filter. Facebook Ads API allows using of one of the following values: EQUAL, NOT_EQUAL, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, IN_RANGE, NOT_IN_RANGE, CONTAIN, NOT_CONTAIN, IN, NOT_IN, STARTS_WITH, ENDS_WITH, ANY, ALL, AFTER, BEFORE, ON_OR_AFTER, ON_OR_BEFORE, NONE, TOP
- - value to compare a field against: it can be a number (without quotes), a string (with quotes), or an array of values (numbers or strings)
A single filter looks like this:
Some popular examples of a single filter (ready to copy-paste):
- Filter by Ad name containing some value:
[ { "field":"ad.name", "operator":"CONTAIN", "value":"Blog" } ]
- Filter by Ad set name equal to value:
[ { "field":"adset.name", "operator":"EQUAL", "value":"Blog" } ]
- Filter by Amount Spend:
[ { "field":"spend", "operator":"GREATER_THAN", "value":10.0 } ]
- Filter for either item on a list of actions (for example, action_type must be link_click orlanding_page_view):
[ { "field":"action_type", "operator":"IN", "value":[ "link_click", "landing_page_view" ] } ]
- Several filters usage in a single importer: [filter_1, filter_2]
[ { "field":"action_type", "operator":"IN", "value":[ "link_click", "landing_page_view" ] }, { "field":"adset.name", "operator":"CONTAIN", "value":"Blog" } ]