Install the SourceLoop tracking pixel
Add the SourceLoop tracking script to your site in three steps. Once installed, every visitor's source, journey, and conversion gets captured automatically.
On this page
This guide walks you through adding the SourceLoop tracking pixel to your marketing site. Once installed, SourceLoop captures every visitor’s source, journey, and any conversion (form submission, meeting, chat, payment) they trigger.
Three steps, around five minutes. Works on every CMS, every framework, every static-site generator.
Which install do you need?
Before you start
You’ll need:
- A SourceLoop account (sign up here if you don’t have one yet)
- Access to your site’s
<head>HTML (or a tag manager like GTM) - A published page to test against once it’s live
Step 1: Copy the tracking snippet
- Sign in to SourceLoop.
- In the left sidebar, open Setup -> Tracking code.
- Copy the snippet shown on the page.
The snippet looks like this:
<script>
window.SourceLoopConfig = { websiteId: "YOUR_WEBSITE_ID" };
</script>
<script async src="https://app.sourceloop.ai/tracking-v3.js"></script>
The websiteId is unique to your workspace and is filled in automatically when you copy from the app. Don’t share the snippet publicly, anyone who has it could send fake events to your account.
Step 2: Paste it into your site’s <head>
Add the snippet inside <head> on every page. The exact location depends on your stack:
- Webflow: Project Settings -> Custom Code -> Head Code
- WordPress: Use the “Insert Headers and Footers” plugin (or “WPCode”), or paste into your active theme’s
header.phpjust before</head> - Next.js / Nuxt / Remix: Paste into the root layout file’s
<head>(e.g.,app/layout.tsx,nuxt.config.ts) - Astro: Add to the global layout’s
<head>(e.g.,src/layouts/BaseLayout.astro) - Shopify: Online Store -> Themes -> Actions -> Edit Code ->
theme.liquid, paste before</head> - BigCommerce: Storefront -> Script Manager -> Create a script, set placement to
<head>on All Pages - Wix: Settings -> Custom Code -> Add Custom Code, placement
<head>, apply site-wide - Squarespace: Settings -> Advanced -> Code Injection -> Header
- Framer: Site Settings -> General -> Custom Code -> Start of
<head>tag - Google Tag Manager: New Tag -> Custom HTML -> paste the snippet, trigger on All Pages
- Plain HTML / custom build: Paste directly into your site template’s
<head>
Step 3: Deploy and reload
Push the change live, then open your site in an incognito window (regular browsers may cache the old version of the page without the new snippet).
That’s it. Visitors hitting your site from this point on are being tracked by SourceLoop, source, journey, and any conversions they trigger.
What gets captured automatically
On a marketing site the snippet captures every form it can see, which is what you want, since almost every form on a marketing site is a lead form. Sign-in, password reset, and one-time-code forms are recognised as credential forms and skipped, so a customer login area on your marketing site does not create fake leads.
If you need to exclude a specific form (an internal tool, a search box, a spam trap), or if you are installing on a logged-in product where most forms are not leads, see Install SourceLoop in your app for the form-exclusion and conversions-mode options.
Verify it’s working
Want to make sure the script is firing correctly? Head to Verify the tracking pixel is installed for the two-minute check.
If you’re stuck, email us at hello@sourceloop.ai with your domain and we’ll take a look.
Frequently asked questions
-
Where exactly does the script go?
Inside the `<head>` tag of every page you want to track. Put it before any other analytics scripts so SourceLoop loads first.
-
Does the script slow down my site?
The tracker is under 8KB gzipped and loads async, so it has no measurable impact on Core Web Vitals. SourceLoop also pre-connects to `app.sourceloop.ai`, which shaves another ~80ms off the handshake.
-
What if I'm using Google Tag Manager?
Create a Custom HTML tag, paste the snippet, and set the trigger to "All Pages". Make sure the tag fires before any consent management platform that might block scripts.
-
Do I need to install the script on every page?
On every page of your marketing site, yes. Site-wide install in `<head>` is the simplest path and every CMS and framework supports it, because forms, meetings, chats, and payments only get attributed on pages where the snippet is loaded. Your logged-in app is the exception, it takes a different install, see Install SourceLoop inside your app.
-
My site uses a strict Content Security Policy. Will SourceLoop be blocked?
If your CSP doesn't already allow `app.sourceloop.ai`, the browser will block the script. Add `app.sourceloop.ai` to your `script-src` and `connect-src` directives. The browser console will show a CSP violation if this is the cause.
-
I have multiple websites under one SourceLoop workspace. Do I install the same snippet on all of them?
It depends on whether they are separate properties or one property. Separate brands or products each get their own `websiteId`, so switch the active website in the dashboard before copying the snippet. But a marketing site and its own app (`www.yoursite.com` and `app.yoursite.com`) are one property and must share a single `websiteId`, otherwise the visit and the signup are recorded as two different people.