Unagi/Docs

Documentation /

Install the script

Unagi is one script tag. Find your site's key in your dashboard under Settings → Install on your site, or replace YOUR_SITE_KEY below:

<script async src="https://youok.uk/u.js" data-key="YOUR_SITE_KEY" data-consent="auto"></script>

It goes in the <head> of every page, ideally through your theme or template so new pages get it automatically. The async attribute means it never slows your page down. It loads from https://youok.uk.

Menus change between versions of these platforms. The principle is always the same: find where the platform lets you add code to the site-wide header.

Shopify

Online Store → Themes → ⋯ → Edit code → open layout/theme.liquid and paste the tag just before </head>. Save.

WordPress and WooCommerce

Use a "header and footer scripts" plugin (or your theme's custom header code option) and paste the tag in the header section. Avoid editing theme files directly unless you use a child theme, because updates overwrite changes.

Wix

Settings → Custom code → Add custom code. Paste the tag, choose "Head", apply it to all pages.

Squarespace

Settings → Advanced → Code injection → Header. Paste the tag and save.

Webflow

Site settings → Custom code → Head code. Paste the tag, save, and publish the site.

Google Tag Manager

Create a Custom HTML tag containing the script tag, fire it on All Pages, and publish. If you gate analytics on consent in Tag Manager, fire it only for visitors who accepted, and then call Unagi.consent(true) (see consent).

Any other site

Paste the tag into the shared header or layout template. Single-page apps are handled automatically: Unagi follows in-app navigation.

Check it is working

  1. Open your site in a normal browser window and view the page source: the script tag should be in the <head>.
  2. In your Unagi dashboard, open Settings → Install on your site and press Check now. It should show Verified.
  3. Browse a few pages. Your event count in the dashboard header should rise within a few seconds.

If nothing arrives, the usual causes are an ad blocker, a content security policy on your site that blocks youok.uk (allow it in script-src and connect-src), or the tag being on only some pages.

Script options

AttributeEffect
data-consent="granted"Use only if your own banner has already been accepted before the script loads (for example, you only output the tag after consent).
data-clicks="off"Stop recording generic click labels. Add-to-cart and checkout clicks are still detected.

Add data-unagi-ignore to any element to stop clicks inside it being recorded.