Hotel Ads - Template Tags

When you create hotel ads, we recommend that you use these template tags in the ad creative and deep-link URLs. When Facebook displays your ad, we replace the template tags with that person's travel selections.

Guidelines

  • Provide template tags in double curly brackets**: {{....}}

  • Before using template tags, provide all required details through your Hotel Events.

    For example, the title of your ad could be:

    Complete your booking to {{hotel.city}} today!

    And the template URL of your ad could deep link people straight to the hotel page they were interested in, with the right checkin and checkout date:

https://www.(...).com/hotels?id={{hotel.hotel_id}}&checkin={{trip.checkin_date date_format:Y-m-d}}&checkout={{trip.checkout_date date_format:Y-m-d}}

Dynamic Dates

Dynamic dates for template tags enable you to continuously update the dates that appear in your ad, without having to re-upload the data in feed. You can use these for Advantage+ catalog ads used for a particular vertical, such as for hotels, flights, destinations, automotive, and so on. You can specify the following options with these tags:

  • Today
  • Today, plus or minus n days
  • Today, plus or minus n months
  • Today, plus or minus n years

The syntax for these tags is as follows:

Today:
{{date.today}}

Today + 12 days:
{{date.today date_offset:+12d}}

Today - 12 days:
{{date.today date_offset:-12d}}

Today + 3 months:
{{date.today date_offset:+3m}}

Today + 3 years:
{{date.today date_offset:+3y}}

By default, we use UTC; however, you can override with a specific time zone. For example:

{{date.today date_timezone:PST}}

Available Template Tags

Template TagDescription

hotel.brand

Hotel brand provided in catalog.

hotel.base_price

If dynamic pricing is provided, this displays the base price from room type. If advertiser has not provided dynamic pricing, this displays the base_price provided in static hotel feed.

trip.checkin_date

The check-in date that Facebook collected for the user from the advertiser. If there is no check-in date collected, this template tag defaults to the next day. We support most of the date formats provided here.

Example:

  • {{trip.checkin_date}}
  • {{trip.checkin_date date_format:Y-m-d}}

trip.checkout_date

The checkout date that Facebook collected for the user from the advertiser. If there is no checkout date collected, this template tag defaults to the day after tomorrow. We support most of the date formats provided here.

Example:

  • {{trip.checkout_date}}
  • {{trip.checkout_date date_format:Y-m-d}}

hotel.city

City provided in catalog.

hotel.city_id

City ID provided in catalog.

hotel.country

Country provided in catalog.

trip.currency_code

The ISO-4217 currency code (for example, "USD") passed by the advertiser in dynamic events (for example, pixel events) using the key currency. If no currency code has been passed for an item, we show the product's feed's default currency.

hotel.description

Hotel description provided in catalog.

hotel.guest_rating

Hotel guest rating provided in your catalog. To use this template tag, at least 30% of the catalog items must have a rating.

hotel.hotel_id

Hotel ID provided by advertiser in catalog.

hotel.name

Hotel name provided in catalog.

hotel.neighborhood

First neighborhood provided in catalog.

trip.num_adults

Number of adult travelers, based on intent signals Facebook collects about the user. Currently defaults to `1;, subject to change.

trip.num_children

Number of children travelers, based on intent signals Facebook collects about the user. Currently defaults to 0; subject to change.

trip.num_travelers

Sum of adult and children travelers, based on intent signals Facebook collects about the user. Currently defaults to 1; subject to change.

hotel.price

If dynamic pricing is provided, this displays the average dynamic price per night with tax and fees. If advertiser has not provided dynamic pricing, this defaults to base price.

hotel.sale_price

If dynamic pricing is provided, this displays the average dynamic sale price per night. If advertiser has not provided dynamic date-based sale price, this defaults to sale price at the room level.

hotel.star_rating

Hotel star rating provided in your catalog feed. To use this tag, at least 30% of the catalog items must have this field.

hotel.total_price

If dynamic pricing is provided, this can be used to display the total price a user has to pay for the entire stay, including tax and fees.

hotel.url

Hotel URL provided in catalog.

Date Template Tags

In addition to the tags above, these date-specific options are available:

Template TagDescription

date.today

Today's date.

date.today date_format:Ymd

Today's date in format 20181231. We support most of the formats defined in PHP, date.

date.today date_offset:OFFSET

+ or - for time later than or earlier than today.

D for days, such as +14D for 14 days from now.

W for weeks, such as -3W for a date 3 weeks ago.

Y for years, such as +1Y for one year from now

date.today date_timezone:TIMEZONE

For example, PST for a date in the PST timezone. If not specified, defaults to UTC.