Booking Attribution and Consent
The widget records where a reservation or online gift card purchase came from: a newsletter, Instagram, a Google ad, another website, or a cross-sell from another location. Restaurants see it on the reservation and on the dashboard; gift card orders store it without showing it yet.
What the widget captures
For each page view the embed script reads the URL and the referrer of your page and keeps only:
| Value | Example |
|---|---|
utm_source, utm_medium, utm_campaign, utm_content, utm_term | instagram, social, autumn-menu |
Ad click ids: gclid, gbraid, wbraid, fbclid, ttclid, msclkid, only after marketing consent | Cj0KCQiA… |
| The host of the referrer | l.instagram.com |
The full URL and the full referrer are never stored or sent: links from newsletters can contain contact data. A referrer from your own website counts as no referrer, so moving between your pages never replaces a campaign.
Without marketing consent (see Consent) the booking carries no ad click ids. With consent Molzait uses them to tell ad clicks apart from other visits, stores them and deletes them 90 days after the booking. Without click ids an ad click counts by its UTM values or the website the guest came from.
Restaurants create links with these parameters in the webapp under Settings, Online reservations, Tracking links.
Include the script on every page
Add the embed script to every page of your website, not only to the reservation page. Use data-hide-button on pages
that should not show the floating button:
<script
data-molzait
data-restaurant="YOUR_RESTAURANT_ID"
data-hide-button="true"
src="https://reserve.molzait.com/assets/embed.js"
type="text/javascript"
defer
></script>
A guest who arrives on your homepage from a campaign link and books later on /reservations then still counts for
that campaign, as long as the stored touch is allowed (see below).
The Molzait WordPress plugin already adds the script to every page.
Consent
Without a consent call the embed script keeps the touch in memory only, without ad click ids. A booking in the same
page view still carries it. The script never reads or writes localStorage.
After the guest agrees to marketing cookies on your website, call:
window.molzait.setConsent({ marketing: true });
The script then reads the ad click ids from the URL of your page and stores the touch in your website's
localStorage for 7 days from the visit that brought the campaign. It keeps the newer campaign of the stored and the
current touch, so a later direct visit never overwrites a campaign.
When the guest declines or withdraws consent, call:
window.molzait.setConsent({ marketing: false });
This removes the stored touch and its ad click ids. The current page view keeps its UTM values and referrer in memory.
API reference
window.molzait.setConsent(consent: { marketing: boolean }): void
Only the boolean true counts as consent. Any other value acts like false. You can call setConsent before the
widget has loaded and as often as you like. The last call wins.
Notes:
- The embed script does not remember consent. Call
setConsenton every page load, after your consent tool knows the guest's choice. window.molzaitexists once the embed script has run. Withdefer,asyncor a script added by a tag manager, your consent tool can decide earlier. The helper below retries for 10 seconds until the script is there:
<script>
function molzaitSetConsent(marketing) {
var tries = 0;
(function apply() {
if (window.molzait) {
window.molzait.setConsent({ marketing: marketing });
} else if (tries++ < 50) {
setTimeout(apply, 200);
}
})();
}
</script>
- Direct booking links (
reserve.molzait.com) never store anything on the device and never read ad click ids, because the booking page has no consent tool. Their UTM values still count for a booking in the same page view.
Declare the storage in your consent tool
The embed script writes no cookies. With marketing consent it writes one localStorage entry on your domain. Add it to
your consent tool's declaration under marketing and to your privacy policy:
| Property | Value |
|---|---|
| Name | molzait_attribution |
| Type | Local storage (HTML5), first party |
| Category | Marketing |
| Duration | 7 days from the visit that brought the campaign. Local storage has no browser expiry: the script ignores an expired entry and overwrites it on the next page view with consent. setConsent({ marketing: false }) deletes it. |
| Purpose | Credits a later reservation or gift card purchase to the campaign or website that brought the visitor. |
| Content | UTM values, ad click ids, the referrer host, the consent flag and the capture time. No full URL and no contact data. |
The widget sends these values to Molzait's servers only with a reservation, waitlist entry or gift card order.
Example: Cookiebot
<script>
window.addEventListener('CookiebotOnConsentReady', function () {
molzaitSetConsent(Cookiebot.consent.marketing);
});
</script>
Example: Google Tag Manager
Create a Custom HTML tag that fires on the trigger your consent tool uses for marketing consent:
<script>
molzaitSetConsent(true);
</script>
Add a second tag with molzaitSetConsent(false) on the trigger for a declined or withdrawn consent. Both tags need
the helper above on the page.
Other consent tools
Most consent tools offer a callback or event once the guest has decided. Call setConsent from there with the
guest's choice for the marketing category.