Skip to content

Install the Widget Script

The tracking script is the one piece every non-WordPress site needs. It enables referral tracking and lets you place the widget anywhere on your pages.

Already on WooCommerce? You don’t need this — the plugin includes the script. This page is for any other site.

Add the script

Add this tag to every page on your site, ideally in the <head> or just before the closing </body>. Replace the Brand ID with yours from Settings → API Keys.

html
<script src="https://api.advocateloop.com/al.js?brand=YOUR-BRAND-UUID"></script>

Your Brand ID is the UUID identifying your brand — see Find your API Key & Brand ID. It’s embedded in the script URL, which is by design and safe to expose in the browser.

Using Google Tag Manager

If you use GTM, create a Custom HTML tag containing the script above and set it to fire on All Pages. The Brand ID is embedded in the script URL, so no other configuration is needed.

What the script does

Once it’s on the page, the script:

  • Detects referral links and tracks referral visits
  • Renders the widget wherever you place a container

Next

Embed a widget on your page →