FAQ

What is the LeadJourney tracking script?

A plain-language explanation of the LeadJourney tracking script – what it does, what it captures and why it's the foundation of every report.

The tracking script is a small piece of JavaScript that runs on your website. It's the foundation everything else in LeadJourney is built on: it recognises your visitors, reads where they came from, and notices when they turn into a lead. Without it, there is nothing for LeadJourney to attribute – your reports stay empty.

In short

The script connects an ad click to the lead it produced and, later, to the revenue that lead generated – so you can finally see which campaigns actually make you money.

Why you need it

Ad platforms like Meta or Google can tell you who clicked your ads. They can't tell you which clicks turned into real, paying customers – that happens on your website, in your forms and in your CRM, long after the click.

The tracking script closes that gap. It sits between the ad click and the conversion and quietly keeps a thread connecting the two. That thread is what lets LeadJourney say "this €4,000 client came from this exact ad" instead of just "this ad got 200 clicks."

What the script actually does

Once it's live on your pages, the script does four things automatically:

  • It identifies each visitor. A first-party identifier is stored in the visitor's browser so the same person can be recognised across pages and return visits.
  • It reads where the visitor came from. It captures the campaign details from the URL – the LeadJourney click ID and the lj_channel, lj_c_id, lj_as_id, lj_ad_id and lj_placement parameters your ads carry – plus the referrer, device and location.
  • It watches for leads. When someone submits a form, the script fires a Lead event. It detects standard <form> submissions, has a formless-click fallback for page builders that don't use a real form element, and a MutationObserver so it keeps working on single-page sites where the URL changes without a full reload.
  • It sends those events to LeadJourney. Page views, leads and later conversions (such as WonClient) are reported back so they can be matched and attributed.

How attribution works

The magic is a single ID that travels through the whole journey:

  1. A visitor clicks your ad. The script captures the click ID and the campaign parameters from the URL.
  2. They submit a form. The script ties that lead to the click ID.
  3. Later, the lead becomes a paying customer. Your CRM (or a postback) sends a conversion event – matched back to the same click ID.
  4. LeadJourney attributes the revenue to the exact channel, campaign, ad set and ad that started it all.

Because every step shares the same click ID, the revenue lands on the right ad – even when the sale happens days or weeks after the click.

Why it loads from your domain

You don't embed a generic third-party script. LeadJourney loads it from a tracking domain on your own website (you point a subdomain via CNAME to package.leadjourney.io). That makes it a first-party script, which means:

  • It's far more resilient to ad blockers and browser tracking restrictions than a third-party tag.
  • The visitor data it relies on lives on your own domain, so it survives longer and stays more accurate.

In practice: more of your real leads actually get tracked, so your attribution reflects reality instead of a fraction of it.

What you stay in control of

The script only does what you tell it to:

  • Turn tracking on or off anytime under Settings → Tracking.
  • Exclude pages where you don't want leads captured (for example /admin or internal tools).
  • You remain responsible for your own cookie/consent setup – the script captures leads on the pages you allow it to.

Is it working?

After you install the snippet, open Settings → Tracking in LeadJourney. It verifies that the script is live on your site and shows the tracking status once the first page views arrive.

The snippet itself is tiny – it looks like this and goes once into every page's <head>:

<!-- LeadJourney tracking -->
<script async
  src="https://track.yourdomain.com/package/latest/YOUR-WORKSPACE-ID/"></script>

Next step

Ready to add it? Follow Install the tracking script for the step-by-step setup.

On this page