Installation

The Moelleux embed is a vanilla JavaScript script, with no dependency, served from our CDN. It is added to your site with a single line.

The one-line snippet

Paste this line just before the closing </head> tag (or at the top of <body>). Replace {site_key} with your own site key.

<script src="https://cdn.moelleux.ca/c/{site_key}.js" async></script>

The async attribute guarantees the embed never blocks your page rendering. The banner appears as soon as the script is ready.

Where to find your site key

The site key (site_key) is a unique UUID generated at provisioning time. You can find it in your dashboard, under each site, in the “Banner” section. It is the same key used in the public URL of your policy (/p/{site_key}).

Gating third-party scripts

To load a script only after the user consents, add the data-consent attribute with the required category. The embed switches the script to type="text/plain" until consent is given, then re-enables it automatically.

<script src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"
        data-consent="analytics"></script>

Example: Google Analytics loaded only after “analytics” consent.

Available categories: analytics, marketing, functional, preferences. The essential category is always active and never requires consent.

What’s next

To drive consent from your own code (enable a category, react to a change, gate custom code), see the client API.

See the client API →