Getting Started
Get AttributionHub up and running on your website in under 5 minutes.
Prerequisites
- A website where you can add JavaScript
- An AttributionHub account (sign up for free )
- A form on your website (contact form, demo request, signup, etc.)
Step 1: Get Your Script
After signing up, you’ll receive a unique tracking script with your license key:
<script
src="https://cdn.attributionhub.com/attribution.js?id=YOUR_LICENSE_KEY"
async
defer
></script>Step 2: Add the Script to Your Website
Paste the script tag into the <head> section of your website, on every page where you want to track visitors:
<head>
<!-- Your other head tags -->
<script
src="https://cdn.attributionhub.com/attribution.js?id=YOUR_LICENSE_KEY"
async
defer
></script>
</head>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
Step 3: 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.
Step 4: Verify It’s Working
- 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