For sites that send guests to opentable.com with ordinary links, and nothing else.
The problem this solves
When a guest follows an ordinary link
(<a href="https://www.opentable.com/...">) to
OpenTable, OpenTable can't report the booking back to your page:
- Links that open a new tab are opened by browsers without any connection back to your page, for security.
- Links that open in the same tab take the guest away from your page altogether.
So the booking has to be recorded on OpenTable's own booking pages instead, and the visitor's ID has to be carried there from your site.
How it works
-
On your site, the tracking script adds the
visitor's ID (
daid) and the current page (dref) to a link to OpenTable at the moment it's clicked. Links aren't changed when the page loads, only when they're clicked. -
OpenTable's Google Tag Manager integration runs
your GTM container inside a hidden frame on OpenTable's booking pages
(on
cdn.otstatic.com). OpenTable passes the visitor's ID and page into that frame. - A second Distil tag runs in that frame, picks up the visitor's ID, and records the booking when OpenTable reports it.
Requirements
- Your site uses Google Tag Manager.
- Your container is connected to OpenTable's GTM
integration. In OpenTable for Restaurants: Integrations
→ Social → Google Tag Manager, then enter your container ID
(
GTM-XXXXXXX). - Your site books only through links. If it also uses OpenTable's widget, a button or an embedded booking page, use OpenTable: widget, button or embedded booking page instead, and replace the links.
Setup
This setup is available from Distil as a ready-made Google Tag Manager import file, including the tag for OpenTable's frame (see Installing with Google Tag Manager).
1. On your site: change the
distil.load(...) line of the tracking script tag to:
distil.load("YOUR_ACCOUNT_KEY", { trackOpenTable: true });
If that line already has options, for example
trackSevenRooms: true, keep them:
{ trackOpenTable: true, trackSevenRooms: true }.
Then change each of its triggers to fire on Some
events, with the condition Page Hostname · does
not contain · otstatic.com. This keeps the site's
tag out of OpenTable's frame, which gets its own tag (below).
2. In OpenTable's frame: create a second tag:
| Setting | Value |
|---|---|
| Tag name | Distil - Tracking Script (OpenTable) |
| Tag type | Custom HTML |
| HTML | the tracking script from the Quick
start, with the distil.load(...) line changed to
distil.load("YOUR_ACCOUNT_KEY", { trackDataLayer: true });
|
| Triggers |
Two triggers, either of which fires the tag: Custom
Event ot-availability-pageview and Custom
Event ot-reservation-made, each on Some
Custom Events, with the condition Page Hostname ·
contains · cdn.otstatic.com
|
| Consent settings | the same as your main tracking tag |
| Tag firing options | Once per event |
Why two triggers: OpenTable sends
ot-availability-pageview when its booking page loads,
together with the visitor's ID from the link, so Distil normally loads
then. But OpenTable's frame waits for the guest's answer to OpenTable's
own cookie prompt. A guest who answers it after that event would be
missed, so ot-reservation-made gives the tag a second
chance: when it loads then, Distil picks up the visitor's ID and the
booking from what OpenTable has already sent, and records the booking
once. If the guest declines OpenTable's cookies, nothing is
recorded.
Don't add your own tag that sends bookings on
OpenTable's ot-reservation-made event. The OpenTable tag
above already records them, and a second tag would send each booking
again.
Checking it
- Click a link to OpenTable on your site. OpenTable's address should
contain
daid=anddref=. - Complete a test booking (and cancel it afterwards). A request
containing
"Value":"book-reservation"is sent from the OpenTable tab.
OpenTable's pages load the published version of your container, so this check only works after publishing.
Comments
0 comments
Please sign in to leave a comment.