subtype for custom audiences for websites, apps, engagement custom audiences, and audiences from offline conversion data. The exception is that subtype is supported for engagement custom audiences for video.page_engaged event:curl -X POST \
-F 'name="My Test Engagement Custom Audience"' \
-F 'rule={
"inclusions": {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": "<PAGE_ID>",
"type": "page"
}
],
"retention_seconds": 31536000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "eq",
"value": "page_engaged"
}
]
}
}
]
}
}' \
-F 'prefill=1' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
| Name | Description |
|---|---|
name
string
| Required. Custom audience name. |
rule
JSON object
| Required. Rules to define the audience. Follows the same syntax as website custom audience. |
type and id fields inside event_sources in the rule to indicate the type and id of the engagement object. The id field takes a single object ID, or an array of IDs of the same type.page: Facebook page ID.lead: Lead form ID.ig_lead_generation: Lead form ID.canvas: Canvas ID.ig_business: Instagram business profile ID.shopping_page: Facebook Shop Page ID.shopping_ig: Instagram Shop ID.ar_experience: An Instant Expereince that uses an AR effect.ar_effects: A Facebook or Instagram effect you own. This doesn’t include effects used in ads.object_id and an event_name.object_id to your Page ID. Under event_name, use one of the following engagement events:page_engaged: People who visited your Page or engaged with any of your Page’s content or ads, on Facebook or Messenger. This is the most inclusive engagement type and includes all other types of engagement.page_visited: People who have visited your Page.page_liked: People who currently like your Page. (See details on retention and rules related to page likes.)page_messaged: People who sent a message to your Page.page_cta_clicked: People who have clicked any call-to-action buttons on your Page (e.g., “Contact Us” or “Shop Now”).page_or_post_save: People who have saved your Page or any of your Page posts.page_post_interaction: People who have interacted with any of your Page posts. Interactions include reactions (i.e., Like, Love, Haha, Wow, Sad, Angry), shares, comments, link clicks or carousel swipes.object_id to FORM_ID and set the rule to track one of the following lead ads events:lead_generation_submitted: All users who completed the form and submitted it.lead_generation_dropoff: All people who close the form without submitting it. They may or may not have filled in any of the fields.lead_generation_opened: All people who opened the lead generation form regardless of whether or not they submitted the form.object_id to "CANVAS_ID". The rule should track one of the following events:instant_shopping_document_openinstant_shopping_document_pauseinstant_shopping_document_resumeinstant_shopping_document_closeinstant_shopping_did_scrollinstant_shopping_element_clickinstant_shopping_element_impressionobject_id should be the "INSTAGRAM_BUSINESS_PROFILE_ID", and the rule should track one of the following Instagram business profile events:ig_business_profile_all: People who visited your Instagram business profile or engaged with any of your Instagram business profile’s content or ads. This is the most inclusive engagement type and includes all other types of engagement. It’s a union of ig_business_profile_engaged, ig_user_messaged_business, and ig_user_messaged_business.ig_business_profile_engaged: People who engagement with your Instagram business profile or engaged with any of your Instagram business profile’s content or ads.ig_user_messaged_business: People who messaged your Instagram business profile.ig_business_profile_visit: People who visited your Instagram business profile.ig_business_profile_ad_saved: People who saved either organic content or an ad from your Instagram business profile.ig_ad_likeig_ad_commentig_ad_shareig_ad_saveig_ad_cta_clickig_ad_carousel_swipeig_organic_likeig_organic_commentig_organic_shareig_organic_saveig_organic_swipeig_organic_carousel_swipeVIEW_CONTENT: People who have viewed your product detail page. This option is available globally.ADD_TO_CART: People who have added your product to their shopping cart. This is available only to checkout enabled businesses, and only to consumers in the United States.PURCHASE: People who have purchased your products. This is available only to checkout enabled business, and only to consumers in the United States.curl -i -X POST
-F 'name="test_api"'\
-F 'rule= {
"inclusions": {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": "<ID>",
"type": "shopping_ig"
}
]
"retention_seconds": <RETENTION_SECONDS>,
"filter": {
"operator": "and",
"filters": [
{
"field":"event",
"operator":"eq",
"value": "VIEW_CONTENT"
}
]
}
}
]
}
}
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
page_messaged and ig_user_messaged_business parameters may not be available in Europe due to new privacy rules.object_id to the AR ads data container ID and for the event_name filed use either ar_camera_open or camera_cta_click.object_id to the AR effect ID and use ar_effect_open for the event_name field.curl -X POST \
-F 'name="My Test Engagement Custom Audience"' \
-F 'rule={
"inclusions": {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": "<PAGE_ID>",
"type": "page"
}
],
"retention_seconds": 31536000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "eq",
"value": "page_engaged"
}
]
}
}
]
},
"exclusions": {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": "<PAGE_ID>",
"type": "page"
}
],
"retention_seconds": 31536000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "eq",
"value": "page_cta_clicked"
}
]
}
}
]
}
}' \
-F 'prefill=1' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
curl -X POST \
-F 'name="My Test Engagement Custom Audience"' \
-F 'rule={
"inclusions": {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": "<PAGE_ID>",
"type": "page"
}
],
"retention_seconds": 31536000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "eq",
"value": "page_engaged"
},
{
"field": "event",
"operator": "eq",
"value": "page_engaged"
}
]
}
}
]
}
}' \
-F 'prefill=1' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
curl -X POST \
-F 'name="My Test Engagement Custom Audience"' \
-F 'rule={
"inclusions": {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": "<PAGE_ID>",
"type": "page"
},
{
"id": "<PAGE_ID>",
"type": "page"
}
],
"retention_seconds": 31536000,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "eq",
"value": "page_engaged"
}
]
}
}
]
}
}' \
-F 'prefill=1' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
retention_seconds=0). Also, Page likes rules can’t be combined with other Page events.curl -X POST \
-F 'name="Page Likes Audience Name"' \
-F 'rule={
"inclusions": {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": "<PAGE_ID>",
"type": "page"
}
],
"retention_seconds": 0,
"filter": {
"operator": "and",
"filters": [
{
"field": "event",
"operator": "eq",
"value": "page_liked"
}
]
}
}
]
}
}' \
-F 'prefill=1' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences