Skip to Content

ConvertKit

ConvertKit (recently rebranded to “Kit”) is an email marketing platform designed for creators, bloggers, and small businesses. It focuses on simplicity, landing pages, and email automation. ConvertKit’s embedded signup forms render as standard HTML <form> elements on the page.

Because ConvertKit embeds are standard HTML forms, AttributionHub’s standard forms handler detects and populates them automatically. You need to add hidden fields to your ConvertKit form and create custom fields in your ConvertKit account to store the attribution data.

Prerequisites

Before you begin, make sure:

  • The AttributionHub tracking script is installed on your site (see Installation)
  • You have a ConvertKit (Kit) account
  • You have access to your website’s code or CMS to modify the form embed code

Step 1: Create Custom Fields in ConvertKit

ConvertKit uses custom subscriber fields to store additional data beyond the default email and name.

  1. In ConvertKit, go to Subscribers (or Grow > Subscribers)
  2. Click the + button to add a custom field, or go to Settings > Custom Fields
  3. For each attribution field, create a custom field:
    • Enter the field name (e.g., ah_lt_channel, ah_lt_source, ah_lt_medium)
    • ConvertKit automatically creates a field key from the name
  4. Repeat for each attribution field you want to capture

Note the field keys — you will use them as name attributes on the hidden input fields.

Step 2: Add Hidden Fields to Your Embed Code

ConvertKit provides an HTML embed code for each form. You need to add hidden input fields that match your custom field keys.

  1. In ConvertKit, go to Landing Pages & Forms (or Grow > Forms)
  2. Open the form you want to use and get the embed code
  3. Paste the embed code on your website
  4. Add hidden input fields inside the <form> element for each attribution value

Here is an example:

<!-- ConvertKit form with attribution hidden fields --> <form action="https://app.convertkit.com/forms/XXXXXXX/subscriptions" method="post" > <!-- Visible fields --> <input type="email" name="email_address" placeholder="Your email" required /> <input type="text" name="fields[first_name]" placeholder="First Name" /> <!-- Attribution hidden fields --> <input type="hidden" name="fields[ah_lt_channel]" value="" /> <input type="hidden" name="fields[ah_lt_source]" value="" /> <input type="hidden" name="fields[ah_lt_medium]" value="" /> <input type="hidden" name="fields[ah_lt_campaign]" value="" /> <input type="hidden" name="fields[ah_lt_landing_url]" value="" /> <input type="hidden" name="fields[ah_ft_channel]" value="" /> <input type="hidden" name="fields[ah_ft_source]" value="" /> <input type="hidden" name="fields[ah_visitor_id]" value="" /> <button type="submit">Subscribe</button> </form>

Note that ConvertKit custom fields use the format fields[field_name] for the name attribute.

Step 3: Configure Field Mapping

Because ConvertKit uses the fields[...] format, you need to configure the field mapping:

<script> window.attrhub = { settings: { fieldMapping: { "latest.attribution.channelGroup": "fields[ah_lt_channel]", "latest.attribution.source": "fields[ah_lt_source]", "latest.attribution.medium": "fields[ah_lt_medium]", "latest.attribution.campaign": "fields[ah_lt_campaign]", "latest.attribution.landingPageUrl": "fields[ah_lt_landing_url]", "first.attribution.channelGroup": "fields[ah_ft_channel]", "first.attribution.source": "fields[ah_ft_source]", visitorId: "fields[ah_visitor_id]", }, }, }; </script>

See Configuration for the full mapping reference.

Step 4: Test the Integration

  1. Visit a page on your site with the ConvertKit form
  2. Open your browser’s DevTools (F12)
  3. Inspect the hidden <input> elements inside the form — they should have attribution values populated
  4. Subscribe with a test email address
  5. In ConvertKit, go to Subscribers and find the test subscriber. Click on the subscriber to view their custom field values — they should contain attribution data

For a full testing walkthrough, see Verify It Works.

How It Works

ConvertKit embedded forms render as standard HTML <form> elements. AttributionHub’s standard forms handler discovers the form, finds hidden fields whose name attributes match the field mapping, and sets the attribution values. When the subscriber submits the form, ConvertKit stores the hidden field values as custom field data on the subscriber record.

Tips

  • Automations — Use custom field values in ConvertKit visual automations. For example, add a condition that checks ah_lt_channel and routes subscribers from “Paid Search” to a high-priority nurture sequence.
  • Segments — Create subscriber segments filtered by attribution custom fields. Send targeted broadcasts to subscribers grouped by traffic source.
  • Tagging — Combine attribution data with ConvertKit tags. Use an automation rule to add tags based on custom field values (e.g., tag subscribers as “Paid Traffic” when ah_lt_channel contains “Paid”).
  • Landing pages — If you use ConvertKit’s landing pages, add the AttributionHub script via ConvertKit’s custom HTML/CSS setting. The form on the landing page will be populated automatically.
  • Multiple forms — AttributionHub populates all ConvertKit forms on the page independently.
  • Creator Network — Attribution data helps you understand which channels drive the most engaged subscribers to your ConvertKit audience.

Troubleshooting

Custom fields are empty for new subscribers

  1. Verify the hidden <input> name attributes use the fields[field_name] format and match the custom field keys in ConvertKit.
  2. Confirm the fieldMapping in your settings maps AttributionHub paths to the correct fields[...] names.
  3. Inspect the hidden fields in DevTools before submitting to confirm they have values.
  4. Enable logging (enableLogging: true in settings) and check the browser Console.

ConvertKit JavaScript-rendered forms

Some ConvertKit embed methods render the form via JavaScript rather than static HTML. If the form loads dynamically, AttributionHub’s MutationObserver and retry mechanism should detect it. If not, check the timing of script loading — make sure the AttributionHub script loads on the page alongside the ConvertKit embed script.

ConvertKit WordPress plugin

If you use the ConvertKit WordPress plugin, forms may be rendered via shortcodes. The resulting HTML is still a standard form, so AttributionHub handles it automatically. Inspect the rendered form in DevTools to find the correct field name attributes for your fieldMapping configuration.