To promote your hotel inventory on Facebook, you have to share information about your hotels with Facebook. You do this by creating a hotel catalog and then filling it with hotels. There are 2 ways you can fill your catalog and update it:
hotel feeds
with your hotel inventoryYou can create and manage your hotel catalogs in your Commerce Manager.
To use the API to manage your catalog:
A hotel feed is a file with your hotel inventory. Every line or item in the file represents a single hotel. You can use one or more hotel feeds, as long as all feeds together contain your full hotel inventory.
CSV sample | TSV sample (flattened) | TSV sample (JSON style)
"
double quotes"
. address
, neighborhood
or image
, can be represented using JSON-encoded values or by a set of "flattened" plain-text columns labeled using JSON-path syntax, such as address.city
, neighborhood[0]
, image[0].url
, image[0].tag[0]
, image[0].tag[1]
. Both conventions can be used interchangeably in the same file.<listings>
XML node encloses a set of <listing>
nodes, each of which represents a hotel.<?xml
declaration tag. The feed parser automatically detects UTF8
, UTF16
, or UTF32
text encodings, and defaults to LATIN1
if it encounters an unexpected byte sequences. You can provide text in field values in any language; however, field names must be given exactly as below, in English.
The following supported fields are designed for items you add to your product catalog.
For localized catalogs, see supported fields for hotel ads.
Field and Type | Description |
---|---|
type: string | Required. Max length: 100 Your unique identifier for the hotel within the catalog. This ID is matched with any Example: |
type: string | Required if adding hotel room information. Enter a unique ID for the hotel room type. Max characters: 100 Example: |
type: string | Required. Most common name of the hotel. Example: |
type: string | Required. Max size: 5000 Brief description of the hotel. Example: |
type: string | Required if adding hotel room information. Check-in date for the hotel stay. You can add up to 180 days from the date the feed is uploaded. Uses ISO-8601 standard ( Example: |
type: string | Required if adding hotel room information. Number of nights for the hotel stay. Example: |
type: string | Required if adding hotel room information. Base price of the hotel room per night. Make sure to add the currency type to the price (for example, USD for U.S. dollars). Format price as the cost, followed by the ISO currency code, with a space between cost and currency. Example: |
type: string | Required if adding hotel room information. Total price of the hotel stay, based on Example: |
type: string | Required if adding hotel room information. Applicable tax rate for the price. Format price as the cost, followed by the ISO currency code, with a space between cost and currency. Example: |
type: string | Required if adding hotel room information. Applicable fees for the price. Format price as the cost, followed by the ISO currency code, with a space between cost and currency. Example: |
type: string | Required. Link to the external site where you can book a hotel room. You can also specify a URL on ad level using Example: |
type: object | |
type: object | |
type: string | Required. Brand name of the hotel chain. Example: |
type: object | |
type: string | Required. Max neighborhoods allowed: 20 Neighborhood where the hotel is located. If there's more than one neighborhood, add additional columns for each one and use JSON-path syntax in each column name to indicate the number of neighborhoods. Example: |
type: float | Required. Latitude of the hotel. Example: |
type: float | Required. Longitude of the hotel. Example: |
type: string | Optional. Sale price per night of hotel stay, based on Example: |
type: object | |
type: object | |
type: float | |
type: string | Optional. Loyalty program you use to gain points for staying at the hotel. Example: |
type: integer | Optional. Indicator of the profitability of the hotel; value from 1 to 10. Example: |
type: string | Optional. Primary phone number for the hotel. Example: |
type: object | Optional. Deep link straight to the hotel details page in your mobile app using App Links. You can specify deep links in order of precedence, highest to lowest:
Learn more about product deep links. |
type: integer | Optional. An indicator of the priority of the hotel; value from 0(lowest priority) to 5(highest priority). Example: |
type: string | Optional. The type of property. The category can be any type of internal description desired. Example: |
type: integer | Optional. Total number of rooms/units in this hotel listing. Example: |
Type: string | Controls whether an item is active or archived in your catalog. Only active items can be seen by people in your ads, shops or any other channels. Supported values: Example: Note: Some partner platforms such as Shopify may sync items to your catalog with a status called staging, which behaves the same as This field was previously called |
Type: string | Max character limit: 100 Up to five custom fields for any additional information you want to filter items by when you create sets. For example, you could use a custom field to indicate all rooms that are part of a summer sale, and then filter those items into a set. This field supports any text value, including numbers. Example: This field is supported by supplementary feeds. |
Type: int | Up to five custom fields for any additional number-related information you want to filter items by when you create sets. This field allows you to filter by number ranges (is greater than and is less than) when you create a set. For example, you could use this field to indicate the year a hotel was opened, and then filter a certain year range into a set. This field supports whole numbers between 0 and 4294967295. It doesn't support negative numbers, decimal numbers or commas, such as -2, 5.5 or 10,000. Example: |
Field Name and Type | Description |
---|---|
type: string | Required. Max items: 20. URL link to the image of the item that will appear in your ads. Follow these image specifications:
Example: Example: |
type: string | Optional. Tag appended to the image that shows what's in the image. There can be multiple tags associated with an image. Examples:
|
Nested or multi-value fields, such as address
can be represented using JSON-encoded values or by a set of "flattened" plain-text columns labeled using JSON-path syntax, such as address.region
. Both conventions can be used interchangeably in the same file.
Field Name and Type | Description |
---|---|
type: object | Required. Primary street address of hotel. Example: |
type: object | Optional. The secondary street address of the hotel. Example: |
type: object | Optional. The tertiary street address of the hotel. Example: |
type: string | Optional. Value to use in deep link URL, Example: |
type: string | Required. City where the hotel is located. Example: |
type: string | Required. State, county, province, where the hotel is located. Example: |
type: string | Required. Country where the hotel is located. Example: |
type: string | Required for countries with a postal code system. Postal or zip code of the hotel. Examples: |
Field Name and Type | Description |
---|---|
type: object | Optional. Total number of people who have reviewed your hotel. If specified, you must also provide Example: |
| Optional. Total number of people who have rated this hotel. Example: |
type: string | Optional. System you use for guest reviews. Examples: |
type: int | Required. Max value for the hotel rating score. Must be greater than or equal to 0, and less than or equal to 100. Example: |
You can use the Hotel API to directly add, edit, and remove hotels in your catalog. Use the Hotel API Reference for more information on how to manage hotels using the API.
The following sections are only relevant to manage your catalogs using this API.
A hotel catalog is a container for your hotel inventory. To use the catalog API, make sure you have the appropriate Marketing API Access Level and that you have accepted the Terms of Service by creating your first catalog through Business Manager.
To create a hotel catalog for hotel ads, set vertical
to hotels
:
curl -X POST \ -F 'name="Test Hotel Catalog"' \ -F 'vertical="hotels"' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v10.0/BUSINESS_ID/owned_product_catalogs
Once you've created the catalog, you must upload your hotel feed(s) to Facebook. Use the API to create a feed object for every feed you want to upload. We support scheduled and direct uploads.
A hotel set is a subset of your catalog. To set up hotel ads, you need a hotel set. Therefore, you need to create at least one.
Hotel sets are defined by filters that are applied to the hotel catalog. For example, you can create a hotel set with all hotels with a star_rating
greater than 3. Note: You can also create a hotel set without any filters. In that case, the hotel set will contain all hotels in your catalog.
To create a hotel set containing all the hotels that contain 'sample brand' mentioned in the brand
field:
curl -X POST \
-F 'name="Test Hotel Set"' \
-F 'filter={
"brand": {
"i_contains": "sample brand"
}
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/<PRODUCT_CATALOG_ID>/product_sets
The filter
parameter is made up of the following operators and data:
Operators | Filter Type |
---|---|
| Contains substring. Operator is case-insensitive. |
| Does not contain substring. Operator is case-insensitive. |
| Contains substring. Operator is case-insensitive. |
| Does not contain substring. Operator is case-insensitive. |
| Equal to. Operator is case-insensitive. |
| Not equal to. Operator is case-insensitive. |
| Less than. For numeric fields only. |
| Less than or equal to. For numeric fields only. |
| Greater than. For numeric fields only. |
| Greater than or equal to. For numeric fields only. |
Data | The data being filtered. |
---|---|
| Your unique identifier for the hotel within the catalog. |
| Brand of the hotel chain. |
| Base price per night for this hotel. The price is in cents (4999 denotes $49.99). |
| Sale price per night for this hotel. The price is in cents (4999 denotes $49.99). |
| Currency |
| City where hotel is located. |
| Country of the hotel. |
| The most common name of the hotel. |
| Hotel star rating. The valid values are between 1 to 5 and should be a multiple of 0.5. |