Skip to Content
Getting Started

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.php or use a plugin like “Insert Headers and Footers”
  • Shopify — Add to theme.liquid before </head>
  • Next.js — Add to your root layout’s <head> or use next/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

  1. Open your website in an incognito/private browser window
  2. Navigate to your site with UTM parameters:
    https://yoursite.com/?utm_source=test&utm_medium=test&utm_campaign=test
  3. Go to the page with your form
  4. Open browser DevTools (F12) > Application > Local Storage
  5. Look for the attrhub key — you should see attribution data stored
  6. Submit a test form and verify the attribution fields are included in the submission

What Happens Next

Once installed, AttributionHub will:

  1. Detect the traffic source on every page load (UTM parameters, referrer, click IDs)
  2. Classify the channel (Paid Search, Organic Social, Email, etc.)
  3. Store attribution data in the visitor’s browser (localStorage)
  4. Populate your forms with the stored attribution data
  5. 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