# Loyalty & Analytics SDK Installation for The Annex
> Source: /partner-guides/the-annex-sdk
> Learn more about the @journey/loyalty script and how to install it EXCLUSIVELY for The Annex Hotel.
> Status: PRIVATE

# Introduction [#introduction]

<Danger>
  **ALERT:** This document is exclusively for use by The Annex hotel and contains code and ID values that would trigger The Annex Branded widget and booking flow.
</Danger>

`@journey/loyalty` is a lightweight, client-side script for allowing guests to join the Journey loyalty program directly from your website and access their official Journey Loyalty account for the purposes of making "members only" reservations on your website. Data shows that the Journey Loyalty SDK increases conversion rates on your direct booking engine, while the **"Members Only Rates"** Closed User Group rates empower your team to increase your public BAR rate (and those of OTA partner's that require narrow rate partity).

The Journey SDK Script also handles some basic analytics to help you gauge performance of the loyalty program and impact on your brand, based in part on the open-source analytics.js library. This script lets you track sessions on the client-side and measure performance of your direct booking engine for various segments (e.g. members vs. non-members, etc.).

<Tip>
  This guide is configured already for The Annex hotel. Reach out to your Alliance Partner Guide at [alliance@journey.com](mailto:alliance@journey.com) with any questions or concerns.
</Tip>

### Create the following Rate & Voucher Codes for Journey Members [#create-the-following-rate--voucher-codes-for-journey-members]

With `@journey/loyalty`, we can detect the status of Journey members and then dynamically insert rate codes appropriate to their status in the Mews booking engine. To do this, we highly suggest creating new Rates and appropriate voucher codes as follows:

| Member                             | Discount    | Code          |
| ---------------------------------- | ----------- | ------------- |
| All Journey Members (Signed-In/Up) | 10% Off BAR | JOURNEY       |
| Legend & Icon Members Only         | 15% Off BAR | JRNYICON15ANX |

Once the above rates & voucher codes are created and published in Mews, please move to the following steps.

### Installing the Journey SDK [#installing-the-journey-sdk]

With `@journey/loyalty`, you can enable your visitors/guests to join the Journey loyalty program directly from your website and access their Journey account for the purposes of making "members only" reservations on your website. Data shows that the Journey Loyalty SDK increase conversion rate on your direct booking engine, while the "Members Only" Closed User Group rates empower your team to increase your public BAR rate (and those of OTA partner's that require narrow rate partity).

Add the following script to your website by adding the `@journey/loyalty` script in the `<head>` section of your HTML file on your website prior to the `</head>`.

```javascript
<script
 src="https://jrny.theannex.com/widgets/latest/widget.js"
 data-brand-id="a3xydb3loggvmcvmvpe5i09d">
</script>
```

## Custom Tracking Domain (CNAME) [#custom-tracking-domain-cname]

Configuring a CNAME helps enhance tracking and analytics for the `@journey/loyalty` program. The latest browser enhancements block third-party tracking and certain analytics by default and this setup helps avoid being blocked inadvertently. For the code to function properly for The Annex, the CNAME must be configured as listed below.

### **What is a Custom Tracking Domain?** [#what-is-a-custom-tracking-domain]

With Journey, you can use a Custom Tracking Domain so Journey Loyalty code, cookies and pixels are loaded from your website’s domain (e.g. `journey.mysite.com`) instead of `start.journey.com`.

To do this, you, or the person in charge of your domain and DNS records will need to add a few specific DNS records for your domain.

1. Create a new CNAME record in the system that manages your DNS records (often where you registered your domain name OR ask your web design firm). The CNAME will allow journey to host it's script files on `jrny.theannex.com` to ensure proper tracking.
2. Create 3 New Records in your DNS system:
   1. a `CNAME` record
      1. Record Type: `CNAME`
      2. Host: `jrny`
      3. Value: `start.journey.com`
   1. a `TXT` record
   2. Record Type: `TXT`
   3. Name: `_cf-custom-hostname.jrny.theannex.com`
   1. Value: `600e7643-1687-4cca-8e95-7c9c768952b7`
   2. a second `TXT` record
   3. Record Type: `TXT`
   1. Name: `_acme-challenge.jrny.theannex.com`
   2. Value: `im9uBAjmA48ZReAGE5DWxcDMhA2zME4z37AVr42f0Qw`

<Note>
  In the above, replace `CNAME` with the HOST you sleected in Step 1 (e.g. journey) and replace `MYSITE.com` with your domain.
</Note>

The outcome of the above, is that the script tag that you place across your site will now be customized to be hosted on your domain such as

```javascript
<script
 src="https://jrny.theannex.com/widgets/latest/widget.js"
 data-brand-id="a3xydb3loggvmcvmvpe5i09d">
</script>
```

## Features [#features]

The `@journey/loyalty` script comes with the following features:

- Loyalty Member Creation
- Existing Member Login
- Member Only Rate Access
- Journey Discovery Remarketing
- Booking Engine Cross-Domain tracking\*
