# Set up your booking engine

Adding Flip.to to your booking engine requires two snippets of code:

* The first is added to [**every page**](#code-snippet-for-every-page) of your booking engine.
* The second is added to the [**confirmation page**](#confirmation-page-snippet).

{% hint style="warning" %}
**Before you begin:** you'll need your unique IDs, which you should have received by email. If not, ask our [Customer Success team](/docs/support/customer-success.md).
{% endhint %}

{% embed url="<https://customer-sr3qzvw7aivuwyt8.cloudflarestream.com/0df2b5b75d1f02f4c4128f5979ee8818/watch>" %}

{% hint style="warning" %}
If your website and booking engine are on the same domain, the instructions below apply only to your booking engine pages. A different snippet is required for [your website pages](/docs/integrations/websites/set-up-your-website-legacy.md).
{% endhint %}

***

## Every page snippet

The following snippet should be modified to pass in the appropriate values (tokens are typically set in place of the actual values), and should be included in the **\<head>** tag of every page of the booking engine, **including** the confirmation page.

{% hint style="info" %}
For single page applications, this snippet should only be loaded at application start, not on virtual pageviews.
{% endhint %}

```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>
<script async src='https://integration.flip.to/K2X4KDP'></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 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>companyCode</td><td>The internal Flip.to company code.</td></tr><tr><td>code</td><td>Internal property code used by the booking engine.<br><br>Set your own internal code used by the engine, and let your account manager know this code.</td></tr><tr><td>language</td><td>The language ANSI code the engine currently uses to display text.<br><br>For English use <code>'en'</code>, French <code>'fr'</code>, 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></tbody></table>

***

## Confirmation page snippet

The following snippet should be modified to pass in the appropriate values and should be included in the **\<head>** tag of the confirmation page to run once the guest has completed their reservation.

Most booking engines support dynamic tokens (i.e. **%FirstName%**) that allows the hotel to display the confirmation page with the guest’s details. If you’re not sure what these tokens are, please contact your booking engine’s support team or introduce our [Customer Success team](/docs/support/customer-success.md) to them.

{% hint style="info" %}
The confirmation page **should include both** the **Every page snippet** and the **Confirmation page snippet** (the order doesn't matter).
{% endhint %}

```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: '2025-4-10',
		endDate: '2025-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. 2025-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/2025 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>

***

## Troubleshooting: Conflicting website code snippet firing on engine pages

Confirm the trigger for the Website GTM Tag is firing on all pages of the website, but excludes firing on all pages of the TravelClick engine. The tag triggers should look like this:

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

<br>


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
