> For the complete documentation index, see [llms.txt](https://docs.flip.to/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flip.to/docs/integrations/booking-engines/set-up-your-booking-engine.md).

# Set up your booking engine

To set up Flip.to, add the following code snippet to the **\<head>** tag of every page of your booking engine—**including the confirmation page**—and take a peek below at any additional configurations.

```html
<script async src="https://integration.flip.to" crossorigin="anonymous"></script>
```

{% hint style="info" %}
We have step-by-step guides for **SynXis**, **Cloudbeds**, **iHotelier** and others—see the [vendor guides](/docs/integrations/booking-engines/vendors.md) for exactly where the snippet goes in yours.
{% endhint %}

***

## Configurations

Once the snippet is in place, Flip.to reads what it needs from the booking engine directly:

* **Which property the page is for.** Depending on the engine, that's read from the URL, from values the engine exposes on the page, or from its data layer.
* **The language**, from the page's own markup.
* **The reservation**, from the confirmation page—confirmation number, guest details, dates, room and rate, currency and amount.

Flip.to has built-in detection for dozens of booking engines. **If yours isn't one of them, the snippet still works**—you supply the same values through the data layer instead, as described under Overrides.

See below for specific configurations that may apply to your booking engine.

<details>

<summary>Tracking add-ons and other products</summary>

If you sell experiences, events or ancillary items at time of booking, those are the one thing we can't read from the page—see [E-commerce tracking](/docs/integrations/booking-engines/e-commerce-tracking.md).

</details>

<details>

<summary>Setting up Consent Management</summary>

See the guide for [Consent management for your booking engine](/docs/integrations/booking-engines/consent-management-for-your-booking-engine.md).

</details>

<details>

<summary>Configuring single-page applications</summary>

For single-page applications, this snippet should only be loaded at application start, not on virtual pageviews.

</details>

<details>

<summary>Overrides</summary>

**Most implementations need none of this**—if Flip.to has built-in detection for your engine, it works from the snippet alone. Use the overrides below when it can't detect what it needs: an engine we don't have built-in detection for, a custom booking-engine domain, or a page whose language markup is wrong or missing. If you're not sure, ask [Customer Success](/docs/support/customer-success.md) first.

#### Setting the property or language directly

Put `data-flipto-code` on any element to set the property code:

```html
<body data-flipto-code="YOUR-PROPERTY-CODE">
```

For language, the attribute goes **on the `<html>` element specifically**—it is not read anywhere else:

```html
<html lang="fr" data-flipto-language="fr">
```

#### Setting values via the data layer

Where a data attribute isn't practical, the same values can be pushed before the snippet loads. This takes precedence over everything Flip.to detects on its own, and goes **before** the Flip.to snippet rather than instead of it.

```javascript
<!-- Flip.to - Booking Engine Integration -->
<script>
!function(b,e,i){(b[e]=b[e]||[]).push({flipto:i, event: 'flipto.configuration.load'})}(window,'fliptoDataLayer',{
	bookingEngine: '[BOOKING-ENGINE]',
	companyCode: '[COMPANY-CODE]',
	code: '[PROPERTY-CODE]',
	language: '[LANGUAGE-CODE]'

});
</script>
<!-- Flip.to - End Booking Engine Integration -->
```

<table><thead><tr><th width="192">Field</th><th>Description</th></tr></thead><tbody><tr><td>bookingEngine</td><td>The Flip.to string identifying your booking engine vendor.<br><br>Ask <a href="/pages/RTdPXa9NV7w0qgds4y6l">Customer Success</a> for the value to use.</td></tr><tr><td>companyCode</td><td>Your internal Flip.to company code.</td></tr><tr><td>code</td><td>The property code used by the booking engine.</td></tr><tr><td>language</td><td><p><em>Optional.</em> The ISO 639-1 language code the engine is displaying—<code>'en'</code>, <code>'fr'</code> and so on. A culture name such as <code>'en-US'</code> also works.</p><p>Only needed when the page's own language markup is missing or wrong; otherwise Flip.to reads it from the page.</p></td></tr></tbody></table>

#### Sending the reservation directly

If your engine can't be read from the confirmation page—or you want to send values you know are correct rather than have them detected—push the reservation on the confirmation page. Anything you send here takes precedence over what Flip.to would otherwise read.

```javascript
<!--Flip.to - Confirmation Page Start-->
<script>
	!function(n,e,w){
		w.eventData={category:'Booking_Engine',action:'Load',value:w.amount};
		(n[e]=n[e]||[]).push({flipto:w,event:'flipto.confirmation.load'});
	}(window,'fliptoDataLayer',
	{
		bookingEngine: '[BOOKING-ENGINE]',
		companyCode: '[COMPANY-CODE]',
		code: '[PROPERTY-CODE]',
		confirmation: '67890',
		loyalty: '12333322',
		first: 'John',
		last: 'Smith',
		email: 'jsmith@flip.to',
		phone: '(212) 123-4567',
		startDate: '2027-4-10',
		endDate: '2027-4-13',
		guests: 5,
		adults: 3,
		children: 2,
		type: 'KING',
		rateCode: 'BAR',
		language: '[LANGUAGE-CODE]',
		currency: 'USD',
		amount: 1234.12,
		addonAmount: 234.56,
		dateFormat: 'yyyy-M-d'
	});
</script>
<!--Flip.to - Confirmation Page End-->
```

<table><thead><tr><th width="219">Field</th><th>Description</th></tr></thead><tbody><tr><td>bookingEngine</td><td>The Flip.to string to define the booking engine used.<br><br>Please contact <a href="/pages/RTdPXa9NV7w0qgds4y6l">Customer Success</a> if you need the name to use for your booking engine vendor.</td></tr><tr><td>confirmation</td><td>Guest’s confirmation number.</td></tr><tr><td>loyalty</td><td>Guest's loyalty program number, if any.</td></tr><tr><td>first</td><td>Guest’s first name.</td></tr><tr><td>last</td><td>Guest’s last name.</td></tr><tr><td>email</td><td>Guest’s email address.</td></tr><tr><td>phone</td><td>Guest’s phone number.</td></tr><tr><td>startDate</td><td>Guest’s check-in date.<br><br>This should be formatted as <code>'yyyy-MM-dd'</code> (i.e. 2027-05-15).<br>If you prefer a different date format use the dateFormat field.</td></tr><tr><td>endDate</td><td>Guest’s check-out date.<br><br>See start date for specifics.</td></tr><tr><td>guests</td><td>The total number of guests.</td></tr><tr><td>adults</td><td>The total number of adult guests.</td></tr><tr><td>children</td><td>The total number of children guests.</td></tr><tr><td>type</td><td>The guest’s room type, if available. Otherwise leave it blank.<br><br>This should include the booking engine internal code, and not the room type description.</td></tr><tr><td>rateCode</td><td>The guest’s rate code, if available; otherwise blank</td></tr><tr><td>groupCode</td><td>The guest’s group code (or block code), if available. Otherwise leave it blank.</td></tr><tr><td>promoCode</td><td>The guest’s promo code, if available. Otherwise leave it blank.</td></tr><tr><td>language</td><td>The language ANSI code the guest has used to make the reservation.<br><br>For English use 'en', French 'fr', etc. Refer to the <a href="http://www.loc.gov/standards/iso639-2/php/code_list.php">complete list of language codes</a>. Use the ISO 639-1 Code for the language parameter.<br><br>Optionally, a culture name can be used as well. For example, this can be set to <code>'en-US'</code> or <code>'en_US'</code>.</td></tr><tr><td>currency</td><td>The 3 character currency code the guest has used to make the purchase.<br><br>A complete list of currency codes can be found <a href="http://www.xe.com/iso4217.php">here</a>. For instance 'USD' for US dollars.</td></tr><tr><td>amount</td><td>The total pre-tax amount used for the room purchase based on the defined currency.<br><br>Amount should be supplied as a valid number including a decimal point if appropriate.</td></tr><tr><td>flightAmount</td><td><p><em>Optional</em></p><p>The total pre-tax amount of the flight portion of the purchase. This can be omitted or set to null if booking engine does not support purchasing flights.</p><p>Amount should be supplied as a valid number including a decimal point if appropriate.</p></td></tr><tr><td>addonAmount</td><td><p><em>Optional</em></p><p>The total amount used for any add-on products and/or services.<br><br>Amount should be supplied as a valid number including a decimal point if appropriate.</p></td></tr><tr><td>dateFormat</td><td><p>Specify a different date format for the startDate and endDate parameters.<br><br>All date fields should be set using the default format:</p><p><code>'yyyy-M-d'</code>.<br></p><p>However, you can define your preferred format instead with this field. For example, if you want to use 12/31/2027 the dateFormat should be set to: <code>'M/d/yyyy'</code>.</p></td></tr><tr><td>products</td><td>To track additional e-commerce products purchased at time of booking, such as events, experiences, ancillary items or other, see our <a href="/pages/5U9HaTMBEANh8Jvf7mUI">E-commerce tracking</a>.</td></tr></tbody></table>

#### Optional dynamic configuration

```javascript
<!-- Flip.to - Configuration -->
<script>
  window.ftParams = {
  "_ga-ft"= "................."
  "enableAdobeCrossDomain": true
}
</script>
<!-- Flip.to - Configuration  -->
```

<table><thead><tr><th width="253">Field</th><th>Description</th></tr></thead><tbody><tr><td>_ga-ft</td><td>Page persistent access to the value of the _ga-ft url parameter.<br><br>Used as a fallback in case the _ga-ft url parameter is removed by the booking engine.</td></tr><tr><td>enableAdobeCrossDomain</td><td>Flag denoting whether Flip.to should attempt to add adobe analytics cross-domain parameters to outbound links.<br><br>Used to enable cross-domain tracking for Adobe analytics.</td></tr></tbody></table>

</details>

<details>

<summary>Troubleshooting: a website tag firing on engine pages</summary>

We recommend adding the snippet directly to the page rather than through Google Tag Manager. If you do deliver your **website** tag via GTM, make sure its trigger fires on your website pages but **excludes** the booking engine, or the two will both fire on engine pages. The triggers should look like this:

<figure><img src="https://lh3.googleusercontent.com/HQ3hq9QI8Oy9AQFCPao30eHMGJchPZqr3qInzjjRpAd_A-yClBZEqIiU2ZyrXfINGDq_ql4iF09pw6JiwVVF5d4c0HOsJMNm6_Ean67YtbRGCMR7MaRdDGvf-I2gu0qU0Ahk202Um5hoj3yPnRHrxA" alt=""><figcaption></figcaption></figure>

</details>

***

Adding Flip.to to your website? See [Set up your website](/docs/integrations/websites/set-up-your-website.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flip.to/docs/integrations/booking-engines/set-up-your-booking-engine.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
