Skip to Content

ActiveCampaign

ActiveCampaign is a popular email marketing and marketing automation platform used for email campaigns, automations, CRM, and lead scoring. It offers two ways to embed forms on your website, and AttributionHub handles both:

  1. Standard inline embed — ActiveCampaign forms rendered as standard HTML <form> + <input> elements on the page. These are handled by the standard forms handler automatically, just like any other HTML form.
  2. Iframe widget mode — ActiveCampaign’s floating widget or modal forms rendered inside cross-origin iframes hosted on activehosted.com. The dedicated handler injects attribution data as URL parameters on the iframe source.

Both modes are detected and populated automatically. No extra configuration is needed beyond adding hidden fields in ActiveCampaign.

Prerequisites

Before you begin, make sure:

  • The AttributionHub tracking script is installed on your site (see Installation)
  • You have an ActiveCampaign account with access to create or edit forms
  • You have access to your website’s code or CMS to add the embed code

Step 1: Create Custom Fields in ActiveCampaign

ActiveCampaign uses custom fields on contacts to store additional data. You need to create these fields so attribution values have somewhere to land.

  1. In ActiveCampaign, go to Settings (gear icon) > Data Management (or Custom Fields under Lists & Forms in older versions)
  2. Click Add Field
  3. For each attribution field you want to track:
    • Set the Field Label to something descriptive (e.g., “Attribution Channel - Latest”)
    • Set the Field Type to Text Input (single line text)
    • Under Personalization Tag (or API name), note the tag name — you will use this as the field name. If ActiveCampaign generates a tag like %ATTRIBUTION_CHANNEL_LATEST%, the underlying field name is typically the lowercase, underscored version
  4. Click Add and repeat for each field

When adding these fields to your form (Step 2), you will map them to the AttributionHub field names.

Step 2: Add Hidden Fields to Your Form

For Standard Inline Embeds

  1. In ActiveCampaign, go to Website > Forms (or Forms under Lists & Forms in older versions)
  2. Open the form you want to edit, or create a new form
  3. In the form builder, add your custom fields to the form
  4. For each attribution field, click on the field and check the Hidden option (or set it to hidden through the field settings)
  5. In the field settings, set the Field Name (the HTML name attribute) to match the AttributionHub field name (e.g., ah_lt_channel)
  6. Save and publish the form

For Iframe Widget Mode

If you use the floating widget embed, the form is inside an iframe. You still need to create the custom fields in ActiveCampaign, but instead of setting them up as hidden form fields, make sure the field names match the ActiveCampaign URL parameter names so they can be pre-filled.

Step 3: Embed the Form on Your Page

Standard inline embed:

<!-- ActiveCampaign standard embed code --> <div class="_form_XX"></div> <script src="https://youraccountname.activehosted.com/f/embed.php?id=XX" type="text/javascript" charset="utf-8" ></script>

The standard forms handler detects inline ActiveCampaign forms automatically. No special configuration needed.

Iframe widget embed:

<script src="https://youraccountname.activehosted.com/f/embed.php?id=XX&type=floating" type="text/javascript" charset="utf-8" ></script>

The dedicated handler detects ActiveCampaign iframes by looking for:

  • iframe[src*="activehosted.com"]
  • iframe[src*="activecampaign.com"]

Step 4: Test the Integration

  1. Visit a page on your site that contains the ActiveCampaign form
  2. Open your browser’s DevTools (F12)
  3. For inline embeds: inspect the hidden <input> elements inside the form and check that they have attribution values
  4. For iframe widgets: find the iframe in the Elements panel and check that its src URL includes attribution parameters
  5. Submit a test form entry
  6. In ActiveCampaign, go to Contacts and find the test submission. The custom fields should contain attribution values

For a full testing walkthrough, see Verify It Works.

How It Works

Standard Inline Embeds

ActiveCampaign’s standard embed renders a regular HTML form on the page. AttributionHub’s standard forms handler discovers forms matching form, .form, [role="form"], and [data-form] selectors, finds hidden fields whose name attributes match your field mapping, and sets their values.

Iframe Widget Mode

For the floating widget / modal form rendered inside a cross-origin iframe:

  1. AttributionHub detects iframes with activehosted.com or activecampaign.com in their src
  2. It reads attribution data from localStorage
  3. It appends field values as URL search parameters on the iframe src
  4. The iframe reloads with the parameters, and ActiveCampaign pre-fills the corresponding fields

The table below lists the most commonly used fields. For the complete field catalog, see Field Reference.

Core Attribution Fields (Latest Touch)

Field NameDescriptionExample Values
ah_lt_channelChannel group (latest touch)Paid Search, Organic Social, Direct
ah_lt_sourceTraffic source nameGoogle, Facebook, Direct
ah_lt_mediumTraffic mediumpaid, organic, social, email
ah_lt_campaignCampaign namespring_sale, Organic Search
ah_lt_contentContent classificationPaid Search Ad, Social Post
ah_lt_termSearch keyword (if available)running shoes
ah_lt_landing_urlLanding page URL (no query string)https://yoursite.com/pricing

Core Attribution Fields (First Touch)

Field NameDescriptionExample Values
ah_ft_channelChannel group (first touch)Paid Search, Organic Social
ah_ft_sourceTraffic source nameGoogle, Facebook
ah_ft_mediumTraffic mediumpaid, organic, social
ah_ft_campaignCampaign namelaunch_campaign
ah_ft_landing_urlOriginal landing page URLhttps://yoursite.com/blog/post

Global Fields

Field NameDescriptionExample Values
ah_visitor_idUnique visitor ID, persistent across visitsa1b2c3d4-e5f6-7890-abcd-ef1234567890
ah_touch_countTotal number of recorded visits5

For additional fields including latest-non-direct touch (ah_lnd_*), drill-down fields, raw UTM parameters, and ad click IDs, see the full Field Reference.

Custom Field Mapping

If your ActiveCampaign custom fields use different names, override the defaults:

<script> window.attrhub = { settings: { fieldMapping: { "latest.attribution.channelGroup": "ac_channel", "latest.attribution.source": "ac_source", "latest.attribution.campaign": "ac_campaign", }, }, }; </script>

See Configuration for the full mapping reference.

Tips

  • Automations — Use attribution data in ActiveCampaign automation triggers. For example, start a different automation sequence for contacts who arrived via “Paid Search” versus “Organic Social”.
  • Lead scoring — Add attribution-based scoring rules. Give contacts from high-intent channels (like branded search) a higher lead score.
  • Segmentation — Create contact segments based on attribution values. Send targeted follow-up emails to contacts grouped by their original traffic source.
  • CRM deals — If you use ActiveCampaign’s CRM features, map attribution fields to deal custom fields to track which marketing channels generate the most pipeline revenue.
  • Site tracking combination — ActiveCampaign has its own site tracking. AttributionHub complements this by providing detailed channel and source attribution that ActiveCampaign’s built-in tracking does not offer.

Troubleshooting

Fields are empty after form submission

  1. For inline embeds, verify the hidden field name attributes exactly match the AttributionHub field names (or your custom field mapping). Names are case-sensitive.
  2. For iframe widgets, inspect the iframe src in DevTools to confirm attribution parameters are present.
  3. Make sure the custom fields exist in ActiveCampaign and are added to the form.
  4. Enable logging (enableLogging: true in settings) and check the browser Console.

Inline form not detected

If your ActiveCampaign inline form uses a non-standard container, add a custom form selector:

window.attrhub = { settings: { formSelectors: ["._form_XX form"], }, };

Replace _form_XX with the actual class of your ActiveCampaign form container.

Widget form not appearing

The floating widget form only appears when triggered (e.g., after a delay or on a button click). AttributionHub’s MutationObserver watches for dynamically inserted iframes, so the widget should be detected when it appears. If attribution data is still missing, check that the iframe loads from an activehosted.com or activecampaign.com domain.