subtype after v3.0 of Marketing API for custom audiences for websites, apps, engagement custom audiences, and audiences from offline conversion data. The one exception is that subtype will still be supported for engagement custom audiences for video.curl \
-F 'name=My Travel Company Events' \
-F 'event_sources=["<PIXEL_ID>","<APP_ID>"]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/<BUSINESS_ID>/event_source_groups
HTTP POST call:curl \
-F 'accounts=["<ACCOUNT_ID_WITHOUT_ACT>"]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/<EVENT_SOURCE_GROUP_ID>/shared_accounts
flight_set_id field is required for a dynamic flight audience. For hotel and destination audiences, you are not required to specify a hotel_set_id or destination_set_id.HTTP POST to /act_<AD_ACCOUNT_ID>/customaudiences.| Field and Type | Description |
|---|---|
claim_objectiveType: enum {TRAVEL} | Required. The objective of the audience. Must be set to TRAVEL. |
content_typeType: enum {HOTEL, FLIGHT, DESTINATION} | Required. Specify the type of signal that should be used to build this audience. Must be set to HOTEL, FLIGHT or DESTINATION. |
event_sourcesType: json string | JSON array of id and type pair. The id field takes a single event source id, and the type field is either a pixel, app, or offline_events. For example:Required if you do not provide event_source_group. If you do provide, do not also provide event_source_group. |
event_source_groupType: id | Specify the event source group whose events will back the audience. Required if you don’t provide event_sources. |
inclusionsType: object[] | Required. An array of JSON objects listing each intent signal that would make a Accounts Center account eligible for this audience. See Inclusion Object Parameters table below. |
descriptionType: string | A further description of the audience. |
exclusionsType: object[] | An array of JSON objects listing each intent signal that would exclude an eligible Accounts Center account from this audience. See Exclusion Object Parameters table below. |
ruleType: object | A classical audience rule to be applied to the event stream before any inclusions and exclusions are processed. Use any of the classical parameters, and see Rule Object Travel Parameters table below for travel ads-specific parameters. |
| Field Name and Type | Description |
|---|---|
eventType: enum {Search, ViewContent, InitiateCheckout, Purchase} | Required. The event name of a signal you want to consider for inclusion. Example: {"event": "Search", …} |
retentionType: object | Required. The minimum/maximum amount of time since the event was received for it to be considered for purposes of inclusion. The retention window must be at least 4 hours. See Retention Object Parameters table below. Example: {…, "retention": {"min_seconds": 0, "max_seconds": 259200}, …} |
booking_windowType: object | Booking window is the time in seconds between the user’s checkin date and the current time. You specify a range and only people whose booking window is within this range are included. Negative booking windows are also supported, allowing you to include people whose checkin date has passed. See Booking Window Object Parameters table below. Examples:
|
countType: JSON operators | The number of times that the event has been fired. You can use both equality and numeric comparison operators here. Examples: {…"count": {"lte": 3}, …} |
| Field Name and Type | Description |
|---|---|
max_secondsType: int | Required. The maximum amount of time (in seconds) since the event was received. Example: 259200 |
min_secondsType: int | The minimum amount of time (in seconds) since the event was received. Example: 0 |
| Field Name and Type | Description |
|---|---|
min_secondsType: int | Required. The minimum amount of time (in seconds) between current date and the desired checkin-date of the user. Example: 172800 |
max_secondsType: int | Required. The maximum amount of time (in seconds) between current date and the desired checkin-date. Example: 604800 |
| Field Name and Type | Description |
|---|---|
eventType: enum { Search, ViewContent, InitiateCheckout, Purchase } | Required. The event name of a signal you want to consider for exclusion. Example: {"event": "Search", …} |
retentionType: object | Required. The minimum/maximum amount of time since the event was received for it to be considered for purposes of exclusion. The retention window must be at least 4 hours. See Retention Object Parameters table below. Example: {…, "retention": {"min_seconds": 0, "max_seconds": 259200}, …} |
JSONoperators.| Field Name and Type | Description |
|---|---|
hotel_set_idType: int | Matches only those events when at least one content_id exists in the specified hotel_set_id.Only for travel audiences with content_type set to HOTEL.Example: {…, "hotel_set_id": {"eq": 123456789}, …} |
destination_set_idType: int | Matches only those events when at least one content_id exists in the specified destination_set_id.Only for travel audiences with content_type set to DESTINATION.Example: {…, "destination_set_id": {"eq": 123456789}, …} |
flight_set_idType: int | Required for flight ads. Matches only those events when the route ( origin_airport to destination_airport) exists in the specified flight_set_id.Only for travel audiences with content_type set to FLIGHT.Example: {…, "flight_set_id": {"eq": 123456789}, …} |
length_of_stayType: int | Number of nights spent during the trip. Example: {… "length_of_stay": {"eq": 1}, …} |
number_of_weekendsType: int | Number of weekends between the start and end date. Example: {…, "number_of_weekends": {"gte": 5}, …} |
num_travelersType: int | Total number of travelers.
Example: {…, "num_travelers": {"gt": 1}, …} |
Date fields:
Type: string | Use relevant date fields based on content_type.Example: {"checkin_date": {"gte": "2016-09-01"}} |
itinerary_contains_dateType: string | Trip contains a specific date. Example: {"itinerary_contains_date": {"eq": "2016-12-25"}} |
curl \
-F 'name=Travel Audience' \
-F 'subtype=CLAIM' \
-F 'claim_objective=TRAVEL' \
-F 'content_type=HOTEL' \
-F 'event_source_group=<EVENT_SOURCE_GROUP_ID>' \
-F 'rule={"num_travelers":{"eq":1}}' \
-F 'inclusions=[
{
"event": "Search",
"count": {"gt":3},
"retention": {"min_seconds":0,"max_seconds":432000}
}
]' \
-F 'exclusions=[{"event":"Purchase","retention":{"min_seconds":0,"max_seconds":172800}}]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
curl \
-F 'name=Travel Audience' \
-F 'subtype=CLAIM' \
-F 'claim_objective=TRAVEL' \
-F 'content_type=HOTEL' \
-F 'event_source_group=<EVENT_SOURCE_GROUP_ID>' \
-F 'rule={"hotel_set_id":{"eq":"<HOTEL_SET_ID>"}}' \
-F 'inclusions=[
{"event":"ViewContent","retention":{"min_seconds":0,"max_seconds":172800}},
{
"event": "InitiateCheckout",
"retention": {"min_seconds":0,"max_seconds":172800}
}
]' \
-F 'exclusions=[{"event":"Purchase","retention":{"min_seconds":0,"max_seconds":172800}}]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
curl \
-F 'name=Travel Audience' \
-F 'subtype=CLAIM' \
-F 'claim_objective=TRAVEL' \
-F 'content_type=FLIGHT' \
-F 'event_source_group=<EVENT_SOURCE_GROUP_ID>' \
-F 'inclusions=[
{
"event": "InitiateCheckout",
"retention": {"min_seconds":0,"max_seconds":432000},
"booking_window": {"min_seconds":172800,"max_seconds":604800}
},
{
"event": "Purchase",
"retention": {"min_seconds":0,"max_seconds":432000},
"booking_window": {"min_seconds":172800,"max_seconds":604800}
}
]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
curl \
-F 'name=Travel Audience' \
-F 'subtype=CLAIM' \
-F 'claim_objective=TRAVEL' \
-F 'content_type=HOTEL' \
-F 'event_source_group=<EVENT_SOURCE_GROUP_ID>' \
-F 'rule={"destination":{"i_contains":"New York City"}}' \
-F 'inclusions=[
{
"event": "Search",
"count": {"gt":3},
"retention": {"min_seconds":0,"max_seconds":172800}
}
]' \
-F 'exclusions=[{"event":"Purchase","retention":{"min_seconds":0,"max_seconds":172800}}]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
checkin_date and checkout_date in the past 2 days but haven’t booked yet:curl \
-F 'name=Travel Audience' \
-F 'subtype=CLAIM' \
-F 'claim_objective=TRAVEL' \
-F 'content_type=HOTEL' \
-F 'event_source_group=<EVENT_SOURCE_GROUP_ID>' \
-F 'rule={
"and": [
{"checkin_date":{"gte":"2018-02-02"}},
{"checkout_date":{"lte":"2018-02-05"}}
]
}' \
-F 'inclusions=[{"event":"Search","retention":{"min_seconds":0,"max_seconds":172800}}]' \
-F 'exclusions=[{"event":"Purchase","retention":{"min_seconds":0,"max_seconds":172800}}]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
curl \
-F 'name=Travel Audience' \
-F 'subtype=CLAIM' \
-F 'claim_objective=TRAVEL' \
-F 'content_type=HOTEL' \
-F 'event_source_group=<EVENT_SOURCE_GROUP_ID>' \
-F 'rule={"itinerary_contains_date":{"eq":"2018-12-25"}}' \
-F 'inclusions=[{"event":"Search","retention":{"min_seconds":0,"max_seconds":172800}}]' \
-F 'exclusions=[{"event":"Purchase","retention":{"min_seconds":0,"max_seconds":172800}}]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
curl \
-F 'name=Travel Audience' \
-F 'claim_objective=TRAVEL' \
-F 'content_type=FLIGHT' \
-F 'event_source_group=<EVENT_SOURCE_GROUP_ID>' \
-F 'rule={"and":[{"returning_departure_date":{"exists":false]}}' \
-F 'inclusions=[
{
"event": "Search",
"count": {"gt":3},
"retention": {"min_seconds":0,"max_seconds":432000}
}
]' \
-F 'exclusions=[{"event":"Purchase","retention":{"min_seconds":0,"max_seconds":172800}}]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences