Skip to Content
Getting Started

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.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

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:

  1. Include the hidden fields in the data your form builder sends to the integration
  2. Map each field to the corresponding property in your CRM (e.g., map ah_lt_channel to 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

  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