Lead source tracking for Shopify.
See where every Shopify form, signup, and quote-request actually came from.
Works with Shopify’s lead-capture forms
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.
Order attribution
- Order-level UTM tracking
- Marketing channel attribution
- Customer acquisition reports
- Shopify Audiences and pixel-based reporting
- Apps for advanced order attribution
Lead-capture attribution
- Contact form source data
- Newsletter signup attribution
- B2B / wholesale form source
- Quote-request marketing channel
- Source on form notifications to staff
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
- 01Open your theme code in Shopify admin. Edit
theme.liquidto add a script that reads URL parameters and stores them in cookies on every page view. - 02Edit each form template (
contact.liquid,customers/register.liquid, etc.) to add hidden inputs and populate them from the cookies on form view. - 03Test that hidden field values flow through to the staff notification email (Shopify’s notification template references specific form fields by name).
- 04Document 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
- 01Paste one script tag into your theme’s
<head>. Or add it via Shopify’s Custom Pixels admin. Either works. - 02We detect every Shopify lead-capture form on the site automatically. Contact, newsletter, B2B quote, custom forms via apps.
- 03Source recorded with the campaign name written out: “Google Ads · Local Services Sydney”. Delivered to your inbox alongside Shopify’s standard form notification.
- 04Theme 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.
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.
<!-- 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.
Three steps. Most sites are done in five minutes.
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.
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.
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.
?utm_source=test to the URL before you submit. That’ll be the source on the lead.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’s head. Every Shopify lead-capture form. Contact, newsletter, quote, wholesale. Source on every submission, alongside Shopify’s own order attribution.
Start freeFree to start · no card