# Quicktext tracking script integration
### Introduction
This document is made for technical team of the booking engines in partnership with Quicktext.
This tracking script allows Quicktext to track ( confirm ) the booking opportunities generated by it's chat-bot.
The tracking contains two scripts:
- **Tracking script**: this code serve for capturing a [query string parameter](https://www.botify.com/learn/basics/what-are-url-parameters) named `qt_tracking_id` and persist it in client browser's `localStorage`.
-- This script must be included on **ALL** booking engine's pages.
- **Confirmation script**: when ran, it collects the tracking ID from URL or `localStorage` and reservation data mentioned in "data attributes". Then send a confirmation event to Quicktext.
-- This script must be used in booking confirmation page, with the required reservation details.
### Tracking script
Include this script on **ALL** booking engine pages
```html
<script type="text/javascript" src="https://tracking.quicktext.im/tracking/generic.min.js"></script>
```
### Confirmation event
Run this script when the user **confirms** the reservation
```html
<script type="text/javascript" src="https://tracking.quicktext.im/tracking/event.min.js"
data-type="qt-tracking-event"
data-event="confirm"
data-partner="<PARTNER_NAME>"
data-price="<TOTAL_RESERVATION_PRICE>"
data-currency="<PRICE_CURRENCY>"
data-check-in="<CHECKIN_DATE>"
data-check-out="<CHECKOUT_DATE>"
data-adults="<ADULTS_COUNT>"
data-childrens="<CHILDRENS_COUNT>"
data-rooms="<ROOMS_COUNT>"
></script>
```
The booking engine technical team must replace the tokens with the corresponding values depending on the reservation's details:
| Token | Type | Format | Is mandatory | Description |
| --------------------------- | ------ | -------------------------------------------------- | ------------ | ------------------------------------------------------------ |
| `<PARTNER_NAME>` | String | | Recommended | The booking engine unique name |
| `<TOTAL_RESERVATION_PRICE>` | Number | | Mandatory | The current booking total price |
| `<PRICE_CURRENCY>` | String | [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) | Mandatory | The current booking total price's currency |
| `<CHECKIN_DATE>` | String | `YYYY-MM-DD` | Recommended | The current booking check-in date |
| `<CHECKOUT_DATE>` | String | `YYYY-MM-DD` | Recommended | The current booking check-out date |
| `<ADULTS_COUNT>` | Number | | Recommended | The current booking adults count |
| `<CHILDRENS_COUNT>` | Number | | Recommended | The current booking children count |
| `<ROOMS_COUNT>` | Number | | Recommended | The current booking rooms count |
Example script:
```html
<script type="text/javascript" src="https://tracking.quicktext.im/tracking/event.min.js"
data-type="qt-tracking-event"
data-event="confirm"
data-partner="SomeBookingEngineName"
data-price="123.456"
data-currency="USD"
data-check-in="2021-05-23"
data-check-out="2021-05-24"
data-adults="2"
data-childrens="1"
data-rooms="1"
></script>
```