Getting Started
Get AttributionHub up and running on your website in a few simple steps.
Prerequisites
- A website where you can add JavaScript
- An AttributionHub account (sign up for free trial )
- A form on your website (contact form, demo request, signup, etc.)
Setup in 4 Steps
Installation — Add the Script to Your Website
After signing up, add the AttributionHub attribution script to the <head> section of your website, on every page where you want to capture visitor sources. The script is the same for all AttributionHub users — your account is verified automatically based on your domain.
<head>
<!-- Your other head tags -->
<script
src="https://cdn.attributionhub.com/attribution.js"
async
defer
></script>
</head>The async defer attributes ensure the script loads without blocking page rendering.
Platform-specific instructions:
- WordPress — Add to your theme’s
header.phpor use a plugin like “Insert Headers and Footers” - Shopify — Add to
theme.liquidbefore</head> - Next.js — Add to your root layout’s
<head>or usenext/script - Webflow — Project Settings > Custom Code > Head Code
- Squarespace — Settings > Advanced > Code Injection > Header
For detailed platform guides, see Installation.
Form Integrations — Add Hidden Fields to Your Forms
Add hidden fields to your forms to capture attribution data. At minimum, add these fields:
<input type="hidden" name="ah_lt_channel" />
<input type="hidden" name="ah_lt_source" />
<input type="hidden" name="ah_lt_medium" />
<input type="hidden" name="ah_lt_campaign" />
<input type="hidden" name="ah_lt_landing_url" />The script will automatically find and populate these fields when your form loads.
Tip: If you use a supported form platform (HubSpot, Gravity Forms, etc.), see Form Integrations for platform-specific setup.
Send Data — Connect to Your CRM or Tools
In most cases you can skip this step. If your form is built with your CRM’s own form builder (HubSpot Forms, Salesforce Web-to-Lead, Marketo Forms), the hidden fields map directly to CRM properties. When someone submits the form, the attribution data arrives in your CRM automatically — no extra configuration needed.
You only need additional mapping when your form builder is separate from your CRM. For example, if you use Gravity Forms, WPForms, Typeform, or Jotform and then push submissions to a CRM via Zapier, Make, or a plugin, you need to:
- Include the hidden fields in the data your form builder sends to the integration
- Map each field to the corresponding property in your CRM (e.g., map
ah_lt_channelto a “Channel” field on your lead/contact record)
See Send Data to CRM or Tools for detailed integration patterns and platform-specific examples.
Verify It Works — Confirm Your Setup
- Open your website in an incognito/private browser window
- Navigate to your site with UTM parameters:
https://yoursite.com/?utm_source=test&utm_medium=test&utm_campaign=test - Go to the page with your form
- Open browser DevTools (F12) > Application > Local Storage
- Look for the
attrhubkey — you should see attribution data stored - Submit a test form and verify the attribution fields are included in the submission
What Happens Next
Once installed, AttributionHub will:
- Detect the traffic source on every page load (UTM parameters, referrer, click IDs)
- Classify the channel (Paid Search, Organic Social, Email, etc.)
- Store attribution data in the visitor’s browser (localStorage)
- Populate your forms with the stored attribution data
- Track conversions when forms are submitted
Every form submission in your CRM will now include the marketing context that brought that lead to your site.
Next Steps
- How It Works — understand the attribution model in detail
- Field Reference — see all available attribution fields
- Form Integrations — platform-specific setup guides
- Configuration — customize behavior and settings