Put it on your site in minutes
One line of code works on every platform that lets you add a script. Choose your platform below, or jump to events, webhooks, and booth mode.
Installation guides
The code is the same everywhere. Replace DITTDOMENE and ID with the values you get in the dashboard.
<script src="https://DITTDOMENE/embed.js" data-campaign="ID" async></script>WordPress
You don't need to touch the theme code. Use a custom code plugin, such as WPCode, or add the code to the theme's footer.
- Install a plugin for adding code to the footer (for example WPCode) and open it.
- Create a new code snippet of type HTML and paste in the embed code.
- Choose the placement Footer (before
</body>) and set the snippet to active. - Reload the page and check that the button appears.
<script src="https://DITTDOMENE/embed.js" data-campaign="ID" async></script>data-mode="inline".Shopify
- Go to Online Store → Themes, click ⋯ → Edit code on the active theme.
- Open the file
layout/theme.liquid. - Paste the embed code right before
</body>. - Save and reload your store.
...
<script src="https://DITTDOMENE/embed.js" data-campaign="ID" async></script>
</body>data-mode="inline".Wix
- Open the dashboard for your site and go to Settings → Custom Code.
- Click Add custom code and paste in the embed code.
- Choose All Pages and place the code in Body - end.
- Save and publish the site.
<script src="https://DITTDOMENE/embed.js" data-campaign="ID" async></script>Squarespace
- Go to Settings → Advanced → Code Injection.
- Paste the embed code into the Footer field.
- Save and reload the page.
<script src="https://DITTDOMENE/embed.js" data-campaign="ID" async></script>Webflow
- Open Project settings → Custom code.
- Paste the embed code into Footer code (before
</body>). - Save and republish the site. Changes don't appear until you publish.
<script src="https://DITTDOMENE/embed.js" data-campaign="ID" async></script>Google Tag Manager
- Create a new tag of type Custom HTML.
- Paste the embed code.
- Set the trigger to All Pages (or only the pages where you want the game).
- Preview, publish the container, and test.
<script src="https://DITTDOMENE/embed.js" data-campaign="ID" async></script>leadwin_result. See events and GA4.Plain HTML
Paste the code right before </body> on every page where you want it. The default mode is a pop-up with a floating button.
<body>
...
<script src="https://DITTDOMENE/embed.js" data-campaign="ID" async></script>
</body>Inline on the page (the game appears where you place it):
<div id="spill"></div>
<script src="https://DITTDOMENE/embed.js"
data-campaign="ID"
data-mode="inline"
data-target="#spill"
data-height="680"
async></script>Custom button that opens a pop-up:
<button data-leadwin-open>Spinn og vinn!</button>
<script src="https://DITTDOMENE/embed.js" data-campaign="ID" data-mode="manual" async></script>React and Next.js
Add the script once, for example in the root layout.
Next.js (next/script):
import Script from "next/script";
export default function RootLayout({ children }) {
return (
<html lang="nb">
<body>
{children}
<Script
src="https://DITTDOMENE/embed.js"
data-campaign="ID"
strategy="afterInteractive"
/>
</body>
</html>
);
}React (standard):
import { useEffect } from "react";
export function Leadwin({ id }) {
useEffect(() => {
const s = document.createElement("script");
s.src = "https://DITTDOMENE/embed.js";
s.async = true;
s.dataset.campaign = id;
document.body.appendChild(s);
}, [id]);
return null;
}window.Leadwin?.open().Embed attributes
All options are optional, except data-campaign.
| Attribute | Value | Description | Standard |
|---|---|---|---|
data-campaign | Required | Campaign ID from the dashboard. | – |
data-mode | popup | inline | manual | popup: a floating button that opens the game in a pop-up. inline: the game appears directly on the page. manual: no button, you open it yourself. | popup |
data-target | CSS selector | The element where the game is placed (only inline). Without a target, the game appears where the script is. | – |
data-position | left | right | Which side the floating button sits on. | From the campaign, otherwise right |
data-delay | Seconds | Delay before the button appears. | From the campaign |
data-exit-intent | true | false | Opens the pop-up when visitors are about to leave the page (the mouse pointer leaves the browser window). Desktop only. | From the campaign |
data-height | Pixels | Height of the game in inline mode. | 680 |
data-text | Text | Text on the floating button. | From the campaign |
Custom button
Add data-leadwin-open to any button or link, and the campaign opens in a pop-up.
<button data-leadwin-open>Spinn og vinn!</button>JavaScript
Open and close from your own code in popup and manual mode.
Leadwin.open();
Leadwin.close();JavaScript events, dataLayer, and GA4
The embed script sends events on window and pushes them to dataLayer, so you can measure your campaign in GTM and GA4.
| Event (window) | dataLayer | When |
|---|---|---|
leadwin:open | leadwin_open | Pop-up opens |
leadwin:close | leadwin_close | Pop-up closes |
leadwin:play | leadwin_play | Visitors have played |
leadwin:result | leadwin_result | The result is shown (win or not) |
The details are in event.detail. For result you get, among other things, win (true/false) and prize (the name of the prize).
Listen for events
window.addEventListener("leadwin:result", function (e) {
console.log("Vant?", e.detail.win, "Premie:", e.detail.prize);
});Send the result to GA4
window.addEventListener("leadwin:result", function (e) {
gtag("event", "leadwin_result", {
win: e.detail.win,
prize: e.detail.prize
});
});// Skriptet gjør dette for deg:
dataLayer.push({
event: "leadwin_result",
campaign: "ID",
detail: { win: true, prize: "10 % rabatt" }
});
// I GTM: lag en trigger av typen «Egendefinert hendelse»
// med hendelsesnavn leadwin_result, og koble den til
// en GA4-hendelse-tag.Send leads on to Zapier, Make, and n8n
With webhooks (Pro and Business), we send a POST request with JSON every time someone plays. Paste the webhook URL into the campaign settings, and you won't need to export leads manually. The URL must be publicly accessible.
Zapier
Create a Zap with the trigger Webhooks by Zapier → Catch Hook, and copy the URL into the campaign.
Make
Add the Webhooks → Custom webhook module and copy the address it shows.
n8n
Use the Webhook node with the POST method, and copy the production URL.
JSON example
{
"event": "entry.created",
"campaign": { "id": "AB12CD34", "name": "Sommerkampanje" },
"entry": {
"name": "Kari Nordmann",
"email": "kari@eksempel.no",
"phone": "",
"company": "",
"answers": {},
"prize": "10 % rabatt",
"win": true,
"code": "VINN-7K2P",
"marketingConsent": true,
"createdAt": "2026-01-15T10:30:00.000Z"
}
}marketingConsent tells you whether the person has said yes to marketing. Respect that in your follow-up.Booth mode and QR code
Booth mode
Open the campaign with ?kiosk=1 on a tablet in full screen. The game resets between participants, ready for the next person.
https://DITTDOMENE/p/ID?kiosk=1QR code on mobile
Let visitors scan a QR code and play on their own phone. This takes pressure off the tablet when there's a line. You'll find the QR code in the dashboard, and under Print materials you can order a poster with a QR code.
Ready to add it?
Create a free account, copy the line of code, and paste it in.
Get started free No credit card · Free plan with 20 games per month · GDPR-friendly