subtype for engagement custom audiences is only supported for video.POST /{ad-account-id}/adsets endpoint for iOS 14.5 SKAdNetwork campaigns.curl -X POST \
-F 'name="My Test Mobile App Custom Audience"' \
-F 'rule={
"inclusions": {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": "<APP_ID>",
"type": "app"
}
],
"retention_seconds": 8400,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "eq",
"value": "fb_mobile_purchase"
}
]
}
}
]
}
}' \
-F 'prefill=1' \
-F 'audience_labels=["HIGH_VALUE_CUSTOMERS"]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
id of the audience upon success. These parameters are most relevant:| Name | Description |
|---|---|
nametype: String | Required. Name of your custom audience. |
descriptiontype: String | Optional. Description of your custom audience. |
ruletype: JSON object | Optional. Rule to define the audience. See Audience Rules. |
200 custom audiences via Custom Audiences from Your Mobile App. Make a POST request to:https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customaudiences
| Name | Description |
|---|---|
nametype: string | Required. Name of your Custom Audience |
retention_daystype: integer | Required. How long someone is in this audience. The minimum number is 1. The maximum number is 180.If retention_days is 14, and on day 13, an audience member triggers an app event matching your criteria, then Facebook extends their time in the audience 14 more days. Someone is in an audience N days from the last matching event they triggered. |
ruletype: JSON Object | Required. Rules to define the audience. See Audience Rules |
audience_labelstype: string | Optional. Choose a label that describes this audience. Labels may be used to find audiences for your ads more effectively. About audience labels. Engaged audiences:
Customers:
|
event_sources, set id to your app’s ID and type to app.'event' as field, if the filter is to specify an event. Parameters that match App events sent by app; for example, “_appVersion”, “_value”, and so on.field attribute is set to "event", the value must be set to an event name. Use the App Event API to see app events and parameters reported by the pixel."count","sum", "avg", "min", and "max".55064006:{
"inclusions: {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": 55064006,
"type": "app"
}
],
"retention_seconds: 2592000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "=",
"value": "fb_mobile_purchase"
}
]
}
}
]
}
}
“timeOnPanel” events in the last 30 days for app id 55064006:{
"inclusions: {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": 55064006,
"type": "app"
}
],
"retention_seconds: 2592000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "=",
"value": "timeOnPanel"
}
]
}
}
]
}
}
“timeOnPanel” events where event value is greater than 30, color is “red” or “blue”, and favorite dessert contains “banana”:{
"inclusions: {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": 55064006,
"type": "app",
}
],
"retention_seconds: 2592000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "=",
"value": "timeOnPanel",
},
{
"field": "_value",
"operator": ">",
"value": 30,
},
{
"field": "color",
"operator": "is_any",
"value": ["red", "blue"],
},
{
"field": "favoriteDessert",
"operator": "contains",
"value": "banana",
}
]
}
}
]
}
}
{
"inclusions: {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": 55064006,
"type": "app"
}
],
"retention_seconds: 2592000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "=",
"value": "fb_mobile_purchase"
}
]
}
"aggregation": {
"type": "count",
"method": "percentile",
"operator": "in_range",
"from": 75,
"to": 100,
}
}
]
}
}
{
"inclusions: {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": 55064006,
"type": "app"
}
],
"retention_seconds: 2592000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "=",
"value": "add_to_cart"
}
]
}
}
]
},
"exclusions": {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": 55064006,
"type": "app"
}
],
"retention_seconds: 2592000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "=",
"value": "fb_mobile_purchase"
}
]
}
}
]
}
}
app_id with a admin, developer, or advertiser role.GET request:https://graph.facebook.com/<API_VERSION>/<APP_ID>/app_event_types
data array of JSON dictionaries having these fields:| Name | Description |
|---|---|
event_nametype: string | App event type to use in rule. |
display_nametype: string | Human-readable name of event type |
descriptiontype: string | Verbose description of standard event |
parameterstype: array | array of JSON dictionaries describing parameters for this event {"parameter_name": "fb_currency", "display_name": "Currency", "description": "Currency for event"}parameter_name: string, App param type to use in ruledisplay_name: string, Human readable name of event type
description: string, Verbose description of parameter, if a standard param |