What it carries
Two groups of parameters, kept apart because they feed two different attributions:
Where each group travels depends on where the guest books. With the widget embedded in your site, the campaign reaches the widget on its own — Restoo.js hands it over — and the click IDs stay on your page, which is where your pixels run and read them. On your Restoo page, the script writes both groups into the link as the visitor follows it, so the widget reads the campaign and the pixels Restoo loads read their click ID from the address.
Each group is replaced whole and never touches the other: a new campaign without a click ID keeps the click ID stored earlier, and a new click ID without a campaign keeps the campaign. A link to your Restoo page that already declares its own campaign keeps it and still receives the click IDs; one that already carries a click ID, from any platform, receives no other.
Installation
1
Add the script to every page of your website
Paste it just before your closing
</body> tag.Why every page? You can’t know which page a campaign will land on, and if
the script isn’t running there, those parameters are never stored: they are
lost the moment the visitor moves to the next page.
2
Declare the consent
Without consent the script stores nothing. There are two ways to declare it:
- With data-restoo-cmp
- With setConsent()
Recommended if your consent platform is a supported one. You declare it with
data-restoo-cmp on the <script> itself.Declaring consent
Consent is declared in one of two ways, and the script behaves the same either way:data-restoo-cmp, an attribute on the<script>: Restoo Attribution Transfer reads the decision from your consent platform.setConsent(signals), a method: you report it yourself from your cookie notice.
data-restoo-cmp
An attribute on the <script>. Declares the consent management platform installed on your website, which Restoo Attribution Transfer reads the visitor’s decision from, including when they change it later. A withdrawal read from that platform deletes anything already stored.
"COOKIEBOT" | "GOOGLE_CONSENT_MODE"
The consent platform the decision is read from. Leave the attribute out and the
consent only ever arrives through
setConsent(). What each
value covers, and where it reads from, is in
Consent.setConsent(signals)
You report the visitor’s decision yourself, instead of Restoo Attribution Transfer reading it from your platform. Call it from your cookie notice when the visitor accepts and when they withdraw consent.
"denied" deletes anything already stored, so a withdrawal needs no separate call.
object
required
An object with the Google Consent Mode v2
ad_storage signal — storage for
advertising purposes — whose value must be exactly "granted" or "denied".
It is the only signal this script uses: pass your platform’s whole consent
object and the rest are discarded.What needs consent
Without permission you don’t lose all the attribution, only the hop between pages. A visitor who arrives from the ad and books without wandering is attributed all the same, because the campaign is still in the address. One who passes through several pages before booking is not — and carrying that across is exactly what this script adds. The same goes for the ad click: the pixel reads it for free from the address it lands on, and remembering it for the next page needs the permission. Campaign attribution covers what needs consent and what doesn’t. The asking is yours, not Restoo’s: the script runs on your own domain, so the one putting the question is your consent platform or your own cookie notice. Restoo only receives the answer. And what it stores is always the last campaign and the last click, each group on its own, expiring after 30 days: the full model is in Campaign attribution.Next steps
Campaign attribution
The full rule: last touch, default values, and the
acquisition object.Consent
How you declare your consent platform, and what each signal unlocks.