Shopify integration

Lead source tracking for Shopify.

See where every Shopify form, signup, and quote-request actually came from.

Works with contact forms, newsletter, quote requests No theme code rewrites, no per-form setup Built for lead capture, not order attribution

Works with Shopify’s lead-capture forms

Contact form Newsletter signup B2B quote requests Wholesale enquiries Custom forms via apps Pop-up forms
The gap

Shopify tracks orders. Lead forms get less love.

Shopify’s analytics are extensive. For orders. Conversion attribution, channel reporting, customer lifetime value. All order-centric. The contact form, newsletter signup, and B2B quote-request flows are afterthoughts in the analytics model. Source data isn’t captured by default on these forms.

What Shopify covers natively

Order attribution

  • Order-level UTM tracking
  • Marketing channel attribution
  • Customer acquisition reports
  • Shopify Audiences and pixel-based reporting
  • Apps for advanced order attribution
What it doesn’t handle

Lead-capture attribution

  • Contact form source data
  • Newsletter signup attribution
  • B2B / wholesale form source
  • Quote-request marketing channel
  • Source on form notifications to staff
The usual workaround

Edit theme.liquid. Hidden fields per form. Hope nothing breaks on theme updates.

The Shopify path to lead-form attribution involves editing the theme’s Liquid templates, adding hidden inputs to every form, writing JavaScript to populate them from URL parameters, and maintaining it through every theme update. It’s do-able. It’s also work.

The manual way

  • 01
    Open your theme code in Shopify admin. Edit theme.liquid to add a script that reads URL parameters and stores them in cookies on every page view.
  • 02
    Edit each form template (contact.liquid, customers/register.liquid, etc.) to add hidden inputs and populate them from the cookies on form view.
  • 03
    Test that hidden field values flow through to the staff notification email (Shopify’s notification template references specific form fields by name).
  • 04
    Document the customizations. Re-apply them after every theme update or major release. Train whoever maintains the theme to not delete the modifications.

With Lead Source

  • 01
    Paste one script tag into your theme’s <head>. Or add it via Shopify’s Custom Pixels admin. Either works.
  • 02
    We detect every Shopify lead-capture form on the site automatically. Contact, newsletter, B2B quote, custom forms via apps.
  • 03
    Source recorded with the campaign name written out: “Google Ads · Local Services Sydney”. Delivered to your inbox alongside Shopify’s standard form notification.
  • 04
    Theme updates don’t affect us. We’re in the head, not the form templates.

// Shopify is for selling. We’re for understanding where the buyers came from.

What you install

One script tag. That’s the whole thing.

Sign up, copy the snippet from your dashboard, paste it into your theme’s head. We detect every lead-capture form on the site automatically. The block below shows what the snippet looks like. Your real one will have your unique site ID baked in.

example only. Your real code is in the dashboard
<!-- illustrative. Paste your real snippet from app.leadsource.co -->
<script src="https://leadsource.co/s/[your-site-id].js" async></script>

The real snippet is generated for your account when you sign up. Copy it from the install page in your dashboard. Under 50ms execution. Async, so it doesn’t block your page. No dependencies.

Install on Shopify

Three steps. Most sites are done in five minutes.

1

Sign up. Get your script tag

Create your free Lead Source account. You’ll see a snippet on the dashboard with your unique site ID already in it. Copy it.

No credit card required to start. The signup flow takes about a minute.
2

Paste it into your Shopify theme’s head

In Shopify admin, go to Online Store → Themes → Edit code → theme.liquid. Paste the snippet just before the closing </head> tag. Save. Alternatively, use Shopify’s Custom Pixels admin (Settings → Customer events → Add custom pixel) to add it without editing theme code.

For order-level attribution with revenue, this isn’t the right tool. There are better-fit Shopify apps for that. Lead Source is specifically for lead-capture form attribution: contact, newsletter, quote, wholesale enquiries.
3

Submit a test through any Shopify form

Open your contact form, newsletter signup, or any lead-capture form. Fill it in. Submit. Within a minute or two, the lead appears in your Lead Source dashboard with source, campaign, and page journey attached.

Want to test attribution end-to-end? Add ?utm_source=test to the URL before you submit. That’ll be the source on the lead.
Common questions

Questions, answered.

Is this for order attribution or lead capture?

Lead capture. Specifically: contact forms, newsletter signups, B2B quote-request flows, wholesale enquiries, and any custom forms you've added via apps. For order-level attribution with revenue data, Shopify's native marketing reports and dedicated attribution apps (e.g., Triple Whale, Northbeam) are built for that, and we don't compete with those.

Will it conflict with my Shopify theme?

No. Lead Source adds one async script tag to the head. It doesn't modify form templates, doesn't change checkout, doesn't inject DOM elements into your storefront. Theme updates won't affect it.

Does it work with apps that add custom forms (Klaviyo signup, Recart, etc.)?

Most of them, yes. If the app emits a standard JavaScript form submission event or fires its own event we can listen for, we capture it. The exception is form apps that submit entirely server-side via the Shopify API. Those bypass the browser DOM. Contact us if you're using such an app and we'll check compatibility.

Should I install via theme.liquid or via Custom Pixels?

Either works. theme.liquid is simpler if you're comfortable editing theme code and have a single theme. Custom Pixels (Shopify Plus or Shopify Standard with the customer-events feature) is cleaner because it persists across theme changes and respects customer-event consent settings. If unsure, theme.liquid is fine for most Shopify stores.

Does it respect Shopify's cookie consent settings?

If installed via Custom Pixels, yes. Shopify gates Custom Pixels based on your customer-consent configuration. If installed via theme.liquid, it's subject to whatever consent management you've configured in your theme. Lead Source captures source only on form submission (a consent event in itself), so the compliance picture is generally favourable either way.

Track your Shopify leads. Free to start.

One script in your theme&rsquo;s head. Every Shopify lead-capture form. Contact, newsletter, quote, wholesale. Source on every submission, alongside Shopify&rsquo;s own order attribution.

Start free

Free to start &middot; no card