Marketing API Version

Dynamic Ads for Travel - Audience Management

This guide assumes you have a catalog with your travel inventory ready, and have set up the required travel events on your website and/or in your mobile app, and have associated your catalog with your event sources.

Create a travel audience in two steps:

Step 1: Create And Share Out A Travel Event Source Group

Besides associating your event sources with your catalog, you must also create an event source group. Event source groups are used to fill audiences.

use FacebookAds\Object\EventSourceGroup;
use FacebookAds\Object\Fields\EventSourceGroupFields;

$event_source_group = new EventSourceGroup(null, <BUSINESS_ID>);
$event_source_group->setData(array(
  EventSourceGroupFields::NAME => 'My Travel Company Events',
  EventSourceGroupFields::EVENT_SOURCES => array(
    <PIXEL_ID>,
    <APP_ID>,
  ),
));

$event_source_group->create();
from facebookads.adobjects.eventsourcegroup import EventSourceGroup

event_source_group = EventSourceGroup(parent_id=<BUSINESS_ID>)
event_source_group[EventSourceGroup.Field.name] = 'My Travel Company Events'
event_source_group[EventSourceGroup.Field.event_sources] = [
    <PIXEL_ID>,
    <APP_ID>,
]

event_source_group.remote_create()
curl \
  -F 'name=My Travel Company Events' \
  -F 'event_sources=["<PIXEL_ID>","<APP_ID>"]' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/<BUSINESS_ID>/event_source_groups

You must then share this event source group out to any ad accounts that wish to create an audience backed by it. Again, this is done by making an HTTP POST call:

use FacebookAds\Object\EventSourceGroup;

$event_source_group = new EventSourceGroup(<EVENT_SOURCE_GROUP_ID>);
// ad account id without 'act_'
$event_source_group->createSharedAccount(array(), array(
  'accounts' => array(
    '<ACCOUNT_ID_WITHOUT_ACT>',
  ),
));
from facebookads.adobjects.eventsourcegroup import EventSourceGroup

event_source_group = EventSourceGroup(<EVENT_SOURCE_GROUP_ID>)
# ad account id without 'act_'
response = event_source_group.create_shared_account(
    params={
        'accounts': ['<ACCOUNT_ID_WITHOUT_ACT>'],
    },
)
print(response)
curl \
  -F 'accounts=["<ACCOUNT_ID_WITHOUT_ACT>"]' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/<EVENT_SOURCE_GROUP_ID>/shared_accounts

Step 2: Create Travel Audiences

At this point you should have your user signal (i.e. pixel and/or app events) set-up and associated with an event source group and your travel catalog(s).

To target people whom have shown explicit travel intent, you must create a dynamic travel audience of people who you would like to serve the ad to. You can include and exclude people based on their travel intent signals. You can also apply additional rule-based filters on top of the events like with Website Custom Audiences. The 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.

To set-up a new travel audience, make an HTTP POST to /act_<AD_ACCOUNT_ID>/customaudiences.

Audience Parameters

Field Name & TypeDescription

name

type: string

A name given to identify the audience.

subtype

type: enum {CLAIM}

Required.

The type of the custom audience.

Must be set to CLAIM.

claim_objective

type: enum {TRAVEL}

Required.

The objective of the audience when the subtype is CLAIM.

Must be set to TRAVEL.

content_type

type: 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_sources

type: 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:

"event_sources": [
 {
 "type": "pixel",
 "id": "562030684179932"
 },
 {
 "type": "app",
 "id": "562030684179934"
 }
] 

Required if you do not provide event_source_group. If you do provide, do not also provide event_source_group.

event_source_group

type: id

Specify the event source group whose events will back the audience. Required if you do not provide event_sources. If you do provide, do not also provide event_sources. Since we will deprecate this field in the next several months, we recommend you migrate to event_sources.

inclusions

type: object[]

Required.

An array of JSON objects listing each intent signal that would make a person eligible for this audience. See Inclusion Object Parameters table below.

description

type: string

A further description of the audience.

exclusions

type: object[]

An array of JSON objects listing each intent signal that would exclude an eligible person from this audience. See Exclusion Object Parameters table below.

rule

type: 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 Dynamic Ads for Travel specific parameters.

Inclusion Object Parameters

Field Name and TypeDescription

event

type: enum {Search, ViewContent, InitiateCheckout, Purchase}

Required.

The event name of a signal you want to consider for inclusion.

Example: {"event": "Search", …}

retention

type: 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_window

type: 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:

  • {"booking_window": {"min_seconds": 0, "max_seconds": 259200}}
  • {"booking_window": {"max_seconds": 0}}

count

type: 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}, …}

Retention Object Parameters

Field Name and TypeDescription

max_seconds

type: int

Required.

The maximum amount of time (in seconds) since the event was received.

Example: 259200

min_seconds

type: int

The minimum amount of time (in seconds) since the event was received.

Example: 0

Booking Window Object Parameters

Field Name and TypeDescription

min_seconds

type: int

Required.

The minimum amount of time (in seconds) between current date and the desired checkin-date of the user.

Example: 172800

max_seconds

type: int

Required.

The maximum amount of time (in seconds) between current date and the desired checkin-date.

Example: 604800

Exclusion Object Parameters

Field Name and TypeDescription

event

type: enum { Search, ViewContent, InitiateCheckout, Purchase }

Required.

The event name of a signal you want to consider for exclusion.

Example: {"event": "Search", …}

retention

type: 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}, …}

Rule Object Travel Parameters

Just as with the classical parameter, each parameter here can be used with any of the standard JSON operators.

Field Name and TypeDescription

hotel_set_id

type: 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_id

type: 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_id

type: int

Required for Dynamic Ads for Flights.

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_stay

type: int

Number of nights spent during the trip.

Example: {… "length_of_stay": {"eq": 1}, …}

number_of_weekends

type: int

Number of weekends between the start and end date

Example: {…, "number_of_weekends": {"gte": 5}, …}

num_travelers

type: int

Total number of travelers

  • For a content_type of hotel or destination this is num_adults + num_children
  • For a content_type of flight, this also includes num_infants

Example: {…, "num_travelers": {"gt": 1}, …}

Date fields:

Dynamic Ads for Hotels

  • checkin_date
  • checkout_date

Dynamic Ads for Flights

  • departing_departure_date
  • departing_arrival_date
  • returning_departure_date
  • returning_arrival_date

Dynamic Ads for Destinations

  • travel_start
  • travel_end

type: string

Use relevant date fields based on content_type.

Example: {"checkin_date": {"gte": "2016-09-01"}}

itinerary_contains_date

type: string

Trip contains a specific date.

Example: {"itinerary_contains_date": {"eq": "2016-12-25"}}

Code Samples

Single travelers who have searched at least 3 times in the last 5 days but haven't booked yet:

use FacebookAds\Object\CustomAudience;
use FacebookAds\Object\Fields\CustomAudienceFields;
use FacebookAds\Object\Values\CustomAudienceSubtypeValues;
use FacebookAds\Object\Values\CustomAudienceClaimObjectiveValues;
use FacebookAds\Object\Values\CustomAudienceContentTypeValues;

$custom_audience = new CustomAudience(null, 'act_<AD_ACCOUNT_ID>');
$custom_audience->setData(array(
  CustomAudienceFields::NAME => 'Travel Audience',
  CustomAudienceFields::SUBTYPE => CustomAudienceSubtypeValues::CLAIM,
  CustomAudienceFields::CLAIM_OBJECTIVE =>
    CustomAudienceClaimObjectiveValues::TRAVEL,
  CustomAudienceFields::CONTENT_TYPE => CustomAudienceContentTypeValues::HOTEL,
  CustomAudienceFields::EVENT_SOURCE_GROUP => <EVENT_SOURCE_GROUP_ID>,
  CustomAudienceFields::RULE => array(
    'num_travelers' => array('eq' => 1),
  ),
  'inclusions' => array(
    array(
      'event' => 'Search',
      'count' => array('gt' => 3),
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 432000),
    ),
  ),
  'exclusions' => array(
    array(
      'event' => 'Purchase',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 172800),
    ),
  ),
));
$custom_audience->create();
from facebookads.adobjects.customaudience import CustomAudience

audience = CustomAudience(parent_id='act_<AD_ACCOUNT_ID>')
audience[CustomAudience.Field.name] = 'Travel Audience'
audience[CustomAudience.Field.subtype] = CustomAudience.Subtype.claim
audience[CustomAudience.Field.claim_objective] = \
    CustomAudience.ClaimObjective.travel
audience[CustomAudience.Field.content_type] = CustomAudience.ContentType.hotel
audience[CustomAudience.Field.event_source_group] = <EVENT_SOURCE_GROUP_ID>
audience[CustomAudience.Field.rule] = {
    'num_travelers': {'eq': 1},
}
audience['inclusions'] = [
    {
        'event': 'Search',
        'count': {'gt': 3},
        'retention': {'min_seconds': 0, 'max_seconds': 432000},
    },
]
audience['exclusions'] = [
    {
        'event': 'Purchase',
        'retention': {'min_seconds': 0, 'max_seconds': 432000},
    },
]

audience.remote_create()
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/v2.11/act_<AD_ACCOUNT_ID>/customaudiences

People who viewed or started booking a hotel in a hotel set in the last 2 days but never completed their booking:

use FacebookAds\Object\CustomAudience;
use FacebookAds\Object\Fields\CustomAudienceFields;
use FacebookAds\Object\Values\CustomAudienceSubtypeValues;
use FacebookAds\Object\Values\CustomAudienceClaimObjectiveValues;
use FacebookAds\Object\Values\CustomAudienceContentTypeValues;

$custom_audience = new CustomAudience(null, 'act_<AD_ACCOUNT_ID>');
$custom_audience->setData(array(
  CustomAudienceFields::NAME => 'Travel Audience',
  CustomAudienceFields::SUBTYPE => CustomAudienceSubtypeValues::CLAIM,
  CustomAudienceFields::CLAIM_OBJECTIVE =>
    CustomAudienceClaimObjectiveValues::TRAVEL,
  CustomAudienceFields::CONTENT_TYPE => CustomAudienceContentTypeValues::HOTEL,
  CustomAudienceFields::EVENT_SOURCE_GROUP => <EVENT_SOURCE_GROUP_ID>,
  CustomAudienceFields::RULE => array(
    'hotel_set_id' => array('eq' => <HOTEL_SET_ID>),
  ),
  'inclusions' => array(
    array(
      'event' => 'ViewContent',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 172800),
    ),
    array(
      'event' => 'InitiateCheckout',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 172800),
    ),
  ),
  'exclusions' => array(
    array(
      'event' => 'Purchase',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 172800),
    ),
  ),
));
$custom_audience->create();
from facebookads.adobjects.customaudience import CustomAudience

audience = CustomAudience(parent_id='act_<AD_ACCOUNT_ID>')
audience[CustomAudience.Field.name] = 'Travel Audience'
audience[CustomAudience.Field.subtype] = CustomAudience.Subtype.claim
audience[CustomAudience.Field.claim_objective] = \
    CustomAudience.ClaimObjective.travel
audience[CustomAudience.Field.content_type] = CustomAudience.ContentType.hotel
audience[CustomAudience.Field.event_source_group] = <EVENT_SOURCE_GROUP_ID>
audience[CustomAudience.Field.rule] = {
    'hotel_set_id': {'eq': <HOTEL_SET_ID>},
}
audience['inclusions'] = [
    {
        'event': 'ViewContent',
        'retention': {'min_seconds': 0, 'max_seconds': 172800},
    },
    {
        'event': 'InitiateCheckout',
        'retention': {'min_seconds': 0, 'max_seconds': 172800},
    },
]
audience['exclusions'] = [
    {
        'event': 'Purchase',
        'retention': {'min_seconds': 0, 'max_seconds': 172800},
    },
]

audience.remote_create()
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/v2.10/act_<AD_ACCOUNT_ID>/customaudiences

People who have initiated check out or purchased the flight tickets in the last 5 days and their flight booking window is between 2 to 7 days:

use FacebookAds\Object\CustomAudience;
use FacebookAds\Object\Fields\CustomAudienceFields;
use FacebookAds\Object\Values\CustomAudienceSubtypeValues;
use FacebookAds\Object\Values\CustomAudienceClaimObjectiveValues;
use FacebookAds\Object\Values\CustomAudienceContentTypeValues;

$custom_audience = new CustomAudience(null, 'act_<AD_ACCOUNT_ID>');
$custom_audience->setData(array(
  CustomAudienceFields::NAME => 'Travel Audience',
  CustomAudienceFields::SUBTYPE => CustomAudienceSubtypeValues::CLAIM,
  CustomAudienceFields::CLAIM_OBJECTIVE =>
    CustomAudienceClaimObjectiveValues::TRAVEL,
  CustomAudienceFields::CONTENT_TYPE => CustomAudienceContentTypeValues::FLIGHT,
  CustomAudienceFields::EVENT_SOURCE_GROUP => <EVENT_SOURCE_GROUP_ID>,
  'inclusions' => array(
    array(
      'event' => 'InitiateCheckout',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 432000),
      'booking_window' => array('min_seconds'=> 172800, 'max_seconds'=> 604800),
    ),
    array(
      'event' => 'Purchase',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 432000),
      'booking_window' => array('min_seconds'=> 172800, 'max_seconds'=> 604800),
    ),
  ),
));
$custom_audience->create();
from facebookads.adobjects.customaudience import CustomAudience

audience = CustomAudience(parent_id='act_<AD_ACCOUNT_ID>')
audience[CustomAudience.Field.name] = 'Travel Audience'
audience[CustomAudience.Field.subtype] = CustomAudience.Subtype.claim
audience[CustomAudience.Field.claim_objective] = \
    CustomAudience.ClaimObjective.travel
audience[CustomAudience.Field.content_type] = CustomAudience.ContentType.flight
audience[CustomAudience.Field.event_source_group] = <EVENT_SOURCE_GROUP_ID>
audience['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},
    },
]

audience.remote_create()
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/v2.11/act_<AD_ACCOUNT_ID>/customaudiences

People who have searched hotels in 'New York City' more than 3 times in the past 2 days but haven't booked yet:

use FacebookAds\Object\CustomAudience;
use FacebookAds\Object\Fields\CustomAudienceFields;
use FacebookAds\Object\Values\CustomAudienceSubtypeValues;
use FacebookAds\Object\Values\CustomAudienceClaimObjectiveValues;
use FacebookAds\Object\Values\CustomAudienceContentTypeValues;

$custom_audience = new CustomAudience(null, 'act_<AD_ACCOUNT_ID>');
$custom_audience->setData(array(
  CustomAudienceFields::NAME => 'Travel Audience',
  CustomAudienceFields::SUBTYPE => CustomAudienceSubtypeValues::CLAIM,
  CustomAudienceFields::CLAIM_OBJECTIVE =>
    CustomAudienceClaimObjectiveValues::TRAVEL,
  CustomAudienceFields::CONTENT_TYPE => CustomAudienceContentTypeValues::HOTEL,
  CustomAudienceFields::EVENT_SOURCE_GROUP => <EVENT_SOURCE_GROUP_ID>,
  CustomAudienceFields::RULE => array(
    'destination' => array('i_contains' => 'New York City'),
  ),
  'inclusions' => array(
    array(
      'event' => 'Search',
      'count' => array('gt' => 3),
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 172800),
    ),
  ),
  'exclusions' => array(
    array(
      'event' => 'Purchase',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 172800),
    ),
  ),
));
$custom_audience->create();
from facebookads.adobjects.customaudience import CustomAudience

audience = CustomAudience(parent_id='act_<AD_ACCOUNT_ID>')
audience[CustomAudience.Field.name] = 'Travel Audience'
audience[CustomAudience.Field.subtype] = CustomAudience.Subtype.claim
audience[CustomAudience.Field.claim_objective] = \
    CustomAudience.ClaimObjective.travel
audience[CustomAudience.Field.content_type] = CustomAudience.ContentType.hotel
audience[CustomAudience.Field.event_source_group] = <EVENT_SOURCE_GROUP_ID>
audience[CustomAudience.Field.rule] = {
    'destination': {'i_contains': 'New York City'},
}
audience['inclusions'] = [
    {
        'event': 'Search',
        'count': {'gt': 3},
        'retention': {'min_seconds': 0, 'max_seconds': 172800},
    },
]
audience['exclusions'] = [
    {
        'event': 'Purchase',
        'retention': {'min_seconds': 0, 'max_seconds': 172800},
    },
]

audience.remote_create()
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/v2.11/act_<AD_ACCOUNT_ID>/customaudiences

People who have searched hotels between specific checkin_date and checkout_date in the past 2 days but haven't booked yet:

use FacebookAds\Object\CustomAudience;
use FacebookAds\Object\Fields\CustomAudienceFields;
use FacebookAds\Object\Values\CustomAudienceSubtypeValues;
use FacebookAds\Object\Values\CustomAudienceClaimObjectiveValues;
use FacebookAds\Object\Values\CustomAudienceContentTypeValues;

$custom_audience = new CustomAudience(null, 'act_<AD_ACCOUNT_ID>');
$custom_audience->setData(array(
  CustomAudienceFields::NAME => 'Travel Audience',
  CustomAudienceFields::SUBTYPE => CustomAudienceSubtypeValues::CLAIM,
  CustomAudienceFields::CLAIM_OBJECTIVE =>
    CustomAudienceClaimObjectiveValues::TRAVEL,
  CustomAudienceFields::CONTENT_TYPE => CustomAudienceContentTypeValues::HOTEL,
  CustomAudienceFields::EVENT_SOURCE_GROUP => <EVENT_SOURCE_GROUP_ID>,
  CustomAudienceFields::RULE => array(
    'and' => array(
      array(
        'checkin_date' => array(
          'gte' => (new \DateTime("+3 day"))->format('Y-m-d')
        ),
      ),
      array(
        'checkout_date' => array(
          'lte' => (new \DateTime("+6 day"))->format('Y-m-d')
        ),
      ),
    ),
  ),
  'inclusions' => array(
    array(
      'event' => 'Search',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 172800),
    ),
  ),
  'exclusions' => array(
    array(
      'event' => 'Purchase',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 172800),
    ),
  ),
));
$custom_audience->create();
from facebookads.adobjects.customaudience import CustomAudience
import datetime

audience = CustomAudience(parent_id='act_<AD_ACCOUNT_ID>')
audience[CustomAudience.Field.name] = 'Travel Audience'
audience[CustomAudience.Field.subtype] = CustomAudience.Subtype.claim
audience[CustomAudience.Field.claim_objective] = \
    CustomAudience.ClaimObjective.travel
audience[CustomAudience.Field.content_type] = CustomAudience.ContentType.hotel
audience[CustomAudience.Field.event_source_group] = <EVENT_SOURCE_GROUP_ID>
audience[CustomAudience.Field.rule] = {
    'and': [
        {
            "checkin_date": {
                "gte": str(datetime.date.today() + datetime.timedelta(days=3)),
            },
        },
        {
            "checkout_date": {
                "gte": str(datetime.date.today() + datetime.timedelta(days=6)),
            },
        },
    ],
}
audience['inclusions'] = [
    {
        'event': 'Search',
        'retention': {'min_seconds': 0, 'max_seconds': 172800},
    },
]
audience['exclusions'] = [
    {
        'event': 'Purchase',
        'retention': {'min_seconds': 0, 'max_seconds': 172800},
    },
]

audience.remote_create()
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/v2.11/act_<AD_ACCOUNT_ID>/customaudiences

People who have searched hotel stays containing a specific date (e.g. Christmas) in the past 2 days but haven't booked yet:

use FacebookAds\Object\CustomAudience;
use FacebookAds\Object\Fields\CustomAudienceFields;
use FacebookAds\Object\Values\CustomAudienceSubtypeValues;
use FacebookAds\Object\Values\CustomAudienceClaimObjectiveValues;
use FacebookAds\Object\Values\CustomAudienceContentTypeValues;

$custom_audience = new CustomAudience(null, 'act_<AD_ACCOUNT_ID>');
$custom_audience->setData(array(
  CustomAudienceFields::NAME => 'Travel Audience',
  CustomAudienceFields::SUBTYPE => CustomAudienceSubtypeValues::CLAIM,
  CustomAudienceFields::CLAIM_OBJECTIVE =>
    CustomAudienceClaimObjectiveValues::TRAVEL,
  CustomAudienceFields::CONTENT_TYPE => CustomAudienceContentTypeValues::HOTEL,
  CustomAudienceFields::EVENT_SOURCE_GROUP => <EVENT_SOURCE_GROUP_ID>,
  CustomAudienceFields::RULE => array(
    'itinerary_contains_date' => array(
      'eq' => (new \DateTime())->setDate(Date('Y'), 12, 25)->format('Y-m-d')
    ),
  ),
  'inclusions' => array(
    array(
      'event' => 'Search',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 172800),
    ),
  ),
  'exclusions' => array(
    array(
      'event' => 'Purchase',
      'retention' => array('min_seconds'=> 0, 'max_seconds'=> 172800),
    ),
  ),
));
$custom_audience->create();
from facebookads.adobjects.customaudience import CustomAudience
import datetime

audience = CustomAudience(parent_id='act_<AD_ACCOUNT_ID>')
audience[CustomAudience.Field.name] = 'Travel Audience'
audience[CustomAudience.Field.subtype] = CustomAudience.Subtype.claim
audience[CustomAudience.Field.claim_objective] = \
    CustomAudience.ClaimObjective.travel
audience[CustomAudience.Field.content_type] = CustomAudience.ContentType.hotel
audience[CustomAudience.Field.event_source_group] = <EVENT_SOURCE_GROUP_ID>
audience[CustomAudience.Field.rule] = {
    "itinerary_contains_date": {
        "eq": str(datetime.date(datetime.date.today().year, 12, 25)),
    },
}
audience['inclusions'] = [
    {
        'event': 'Search',
        'retention': {'min_seconds': 0, 'max_seconds': 172800},
    },
]
audience['exclusions'] = [
    {
        'event': 'Purchase',
        'retention': {'min_seconds': 0, 'max_seconds': 172800},
    },
]

audience.remote_create()
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/v2.11/act_<AD_ACCOUNT_ID>/customaudiences

Once you have created your audience(s), they can then be added to the targeting spec in your Dynamic Ads for travel campaign.