Loyalty on your website
How a hotel group puts its loyalty club on its own website and in its booking engines, so a guest joins or signs in once and is recognised everywhere they go next.
The three pieces
Join and sign in to the club without leaving the hotel’s website. One line of code; the hotel sets it up in GuestMaker.
The booking engine recognises the member, to show member rates and fill in their details.
A guest who signs in once is signed in for 30 days, on the member portal and in every booking engine of the group.
What the guest experiences
With all three pieces in place, this is the whole journey.
- 1
On the hotel’s website, the guest clicks “Join the club” or “Sign in”. The popup opens over the page.
- 2
Joining, and signing in with an emailed link, finish inside the popup. Signing in with a password changes the page once, to the guest’s member portal or, if the website asks for it, straight back to the page they were on: that one page change is what signs them in.
- 3
The guest goes on to book. The booking engine sends them to the GuestMaker sign-in, they are already signed in, so they come straight back without seeing a form, recognised.
- 4
When the guest logs out, from the portal or from a booking engine, they are signed out everywhere.
Who does what
| Piece | Hotel team (in GuestMaker) | Website or engine developer |
|---|---|---|
| Website popup | Lists the websites allowed to show it, in Loyalty → Program → Website popup. | Adds one line of code and points the buttons at it. |
| Booking engine sign-in | Asks GuestMaker for the engine’s credentials. | Connects the engine with one of the two sign-in guides. |
| Shared sign-in | Nothing. | Nothing. It works on its own once the pieces above are in place. |
1. Add the popup to the website
Paste this line once in the head of every page, or add it in Google Tag Manager as a Custom HTML tag on all pages. Replace the program name with the hotel group’s, shown in Loyalty → Program → Website popup.
<script src="https://www.guestmaker.ai/sdk/loyalty-popup.js" data-program="your-program" async></script>
Then open it from any button
| Do this | Good for |
|---|---|
href="#gm-enroll" or href="#gm-login" | Any site builder: set the button’s link and nothing else. |
data-gm-loyalty="enroll" or "login" | Any element, when you control the HTML. |
| Existing links to the club’s pages | Nothing to change: they open the popup instead of leaving the site. |
?gm-loyalty=enroll on any page | Emails, adverts and QR codes that should land with the popup open. |
GuestMakerLoyaltyPopup.open("login") | Your own JavaScript. |
Good to know
- The popup shows the club’s real join and sign-in pages, with the design, languages and rules set in GuestMaker. It follows the page’s language unless you set
data-lang. - It only opens on the websites the hotel listed. Anywhere else the guest gets a “Continue” button to the full page, never a dead button.
- A site with a strict Content-Security-Policy must allow
https://www.guestmaker.aiinscript-src,frame-srcandconnect-src. - To bring the guest back to the page they were on after a password sign-in, instead of to the member portal, add
data-after-sign-in="page"to the script line. Only pages on the websites the hotel listed come back; anything else lands on the portal. - If members use the portal on the hotel’s own address, add
data-portal-host="rewards.hotel.com"so links to it open the popup too. On its own it also moves the sign-in to that address. With a booking engine connected, read the next section first. - The popup starts loading when the guest points at, focuses or touches a button that opens it. To have it ready even on a phone, add
data-preload="login"(or"enroll"): it then loads quietly once the page is idle. It costs one popup load per visit, opened or not.
The hotel’s own portal address and a booking engine
These two settings often sit on the same line and do different jobs:
| Setting | What it decides |
|---|---|
data-portal-host="rewards.hotel.com" | Links to the hotel’s own portal address open the popup. Without the next setting, the guest also signs in on that address. |
data-sign-in-host="platform" | The guest always signs in on www.guestmaker.ai, the sign-in every booking engine reads. After a password sign-in GuestMaker also sets the sign-in on the hotel’s own address before the guest comes back to the page. |
With a booking engine connected, keep both. A sign-in on the hotel’s own address is not seen by the booking engines, so the guest would be asked to sign in again to book. This is the line the install code in GuestMaker gives you in that case:
<script src="https://www.guestmaker.ai/sdk/loyalty-popup.js" data-program="your-program" data-portal-host="rewards.hotel.com" data-sign-in-host="platform" data-after-sign-in="page" data-client-id="rp_your_website_client" async></script>
In this mode a password sign-in passes automatically through the hotel’s own address before the guest comes back to the page. The same sign-in is then kept there too, so the website’s sign-in buttons change to “Hi, Ana” and open the member portal in the popup, with nothing to build on the website. To know the member on the website’s server, use the website’s own client: showing “Hello, Maria” on the website.
Events for your analytics
Each step fires a gm-loyalty:<event> event on the window and, if Google Tag Manager is on the page, a gm_loyalty_<event> entry in its data layer. The events say what happened, never who the guest is.
window.addEventListener("gm-loyalty:enrolled", (e) => {
// e.detail → { program: "your-program", view: "enroll" }
});
// open · ready · enrolled · link-sent · signed-in · close · error2. Connect the booking engines
Each booking engine sends the guest to the GuestMaker sign-in and gets them back recognised. There are two ways to connect one; both share the same sign-in.
3. The shared sign-in
Signing in anywhere (the popup, the member portal or a booking engine) signs the guest in with GuestMaker for 30 days, for that hotel group only. Every booking engine then gets the guest back without a form. Each engine can also:
| Need | How |
|---|---|
| Check quietly whether the guest is signed in, without showing anything | prompt=none |
| Always show the form (another person, a shared computer) | prompt=login |
| Log the guest out everywhere | The logout in each guide |
Showing “Hello, Maria” on the website
The browser never tells the website who signed in: the sign-in lives on GuestMaker’s address, where no script on the website can read it. To greet the member or show member prices on the website itself, the website’s server connects exactly like a booking engine: it gets its own credentials and uses the Club externo sign-in with prompt=none. A signed-in guest comes back recognised; anyone else comes back with ?hlError=login_required and sees the normal page.
Right after a sign-in in the popup there is a shorter way. Add data-client-id with the website’s client id next to data-after-sign-in="page": the guest comes back to the page with ?hlCode=…, a single-use code that lives five minutes. The website’s server exchanges it with its client secret, exactly as a booking engine does, and gets the member: name, email, tier, language and consent. Nothing about the member can be read by scripts on the page.
When a booking engine is connected this is required, not optional: the hotel creates the website’s client in GuestMaker (Loyalty, Program, Website popup) before the install code appears, and sends you its id and secret.
<script src="https://www.guestmaker.ai/sdk/loyalty-popup.js" data-program="your-program" data-after-sign-in="page" data-client-id="rp_your_website_client" async></script>Club externo: keeping the guest signed in
- A password sign-in in the popup changes the page once. Browsers do not let a page inside a popup frame keep a sign-in, so the page changes once to finish: to the member portal, or straight back to the same page with
data-after-sign-in="page". Joining and emailed-link sign-in stay in the popup. - The shared sign-in lives on the GuestMaker address. If the hotel serves its member portal on its own address (such as rewards.hotel.com), a sign-in there is not seen by the booking engines, which always sign in through GuestMaker: the guest will be asked to sign in once more when they book. Add
data-sign-in-host="platform"to sign in on GuestMaker’s address instead (the install code in GuestMaker adds it when a booking engine is connected). Keepdata-portal-hoston the line: it then only makes links to the hotel’s own address open the popup. - One hotel group per sign-in. A guest of another group’s club signs in again.