HubSpot Forms + LinkedIn Ads Conversion Tracking Setup

I see this setup broken in about 60% of accounts I audit. HubSpot’s native tracking handles most conversions automatically, but LinkedIn’s tracking is less mature than Google or Meta — and when you’re embedding HubSpot forms on non-HubSpot sites, you’re flying blind unless you set up proper event listeners. The result? You’re missing 20-30% of your actual form conversions in LinkedIn reporting.

Most people assume HubSpot’s native LinkedIn integration handles everything, but it only works for forms on HubSpot-hosted pages. Embedded forms need GTM listeners to fire LinkedIn’s conversion events properly.

What You’ll Have Working By The End

Prerequisites

Step 1: Install LinkedIn Insight Tag Base Code

If you don’t already have LinkedIn’s base tracking installed, you need this first. Without it, conversion events won’t fire.

In GTM, create a new Custom HTML tag:

<script type="text/javascript">
_linkedin_partner_id = "YOUR_PARTNER_ID";
window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
window._linkedin_data_partner_ids.push(_linkedin_partner_id);
</script>

<script type="text/javascript">
(function(){var s = document.getElementsByTagName("script")[0];
var b = document.createElement("script");
b.type = "text/javascript";b.async = true;
b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js";
s.parentNode.insertBefore(b, s);})();
</script>

Replace YOUR_PARTNER_ID with your actual LinkedIn Partner ID (find this in Campaign Manager → Account Assets → Insight Tag).

Set this tag to fire on All Pages trigger.

Step 2: Create HubSpot Form Submission Listener

HubSpot forms fire different events depending on where they’re hosted. For HubSpot-hosted pages, use hsFormCallback. For embedded forms, use addEventListener. I always set up both to cover all scenarios.

Create a Custom HTML tag in GTM:

<script>
// Listen for HubSpot form submissions
window.addEventListener('message', function(event) {
    if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') {
        // Push to data layer for GTM
        dataLayer.push({
            'event': 'hubspot_form_submit',
            'form_id': event.data.id,
            'form_guid': event.data.formGuid
        });
    }
});

// Alternative method for embedded forms
document.addEventListener('hsFormCallback', function(event) {
    if (event.eventName === 'onFormSubmitted') {
        dataLayer.push({
            'event': 'hubspot_form_submit',
            'form_id': event.id,
            'form_guid': event.formGuid
        });
    }
});

// Fallback for forms that use jQuery events (older HubSpot implementations)
$(document).ready(function() {
    $(document).on('hsFormCallback', function(event) {
        if (event.eventName === 'onFormSubmitted') {
            dataLayer.push({
                'event': 'hubspot_form_submit',
                'form_id': event.id,
                'form_guid': event.formGuid
            });
        }
    });
});
</script>

Fire this tag on All Pages so it’s listening everywhere HubSpot forms might appear.

Which should you use? All three. HubSpot’s form implementation varies depending on how forms are embedded, what version of their tracking code you’re running, and whether you’re on HubSpot-hosted pages or not. I’ve seen accounts where only one of these methods works reliably.

Step 3: Create GTM Trigger for Form Submissions

Create a new Custom Event trigger in GTM:

This trigger will fire whenever our listener code pushes the hubspot_form_submit event to the data layer.

Step 4: Set Up LinkedIn Conversion Event Tag

Create a new Custom HTML tag for the LinkedIn conversion event:

<script>
lintrk('track', { 
    conversion_id: YOUR_CONVERSION_ID,
    conversion_value: {{Form Conversion Value}}, // Optional: set this variable in GTM
    currency: 'USD' // Optional: adjust as needed
});
</script>

Replace YOUR_CONVERSION_ID with your actual LinkedIn conversion ID. Find this in Campaign Manager → Account Assets → Conversions → click your conversion → Tracking Details.

Set this tag to fire on your hubspot_form_submit trigger.

Fire on: Your HubSpot form submission trigger Tag sequencing: Set to fire after the LinkedIn Insight Tag (use Tag Sequencing in Advanced Settings)

Step 5: Create Conversion in LinkedIn Campaign Manager

Before your tracking will work, you need to set up the conversion action in LinkedIn:

  1. Go to Campaign Manager → Account Assets → Conversions
  2. Click Create Conversion
  3. Choose Website as conversion type
  4. Set conversion details:
    • Name: “HubSpot Form Submission” (or whatever makes sense for your business)
    • Category: Lead (typically for forms)
    • Attribution window: 30 days view, 30 days click (LinkedIn default)
    • Value: Set if you assign monetary value to leads
  5. Copy the Conversion ID — you’ll need this for step 4

The conversion won’t show data until it starts receiving events from your website.

Testing & Verification

GTM Preview Mode:

  1. Open your website in GTM Preview mode
  2. Fill out and submit a HubSpot form
  3. Check that the hubspot_form_submit event fires in the data layer
  4. Verify your LinkedIn conversion tag fires after the form event
  5. Look for any JavaScript errors in browser console

LinkedIn Campaign Manager:

  1. Go to Campaign Manager → Analyze → Conversions
  2. Select your conversion action
  3. Check for test conversions (they usually appear within 15-30 minutes)
  4. Verify the conversion timestamp matches your form submission

Cross-check the numbers: Compare HubSpot form submissions to LinkedIn conversion reports. In most B2B setups, I expect to see:

Red flags:

Troubleshooting

Problem: GTM shows hubspot_form_submit event firing, but LinkedIn shows no conversions Solution: Check that your LinkedIn Insight Tag base code is installed and firing before the conversion event. Use Tag Sequencing in GTM to ensure proper order. Also verify your Conversion ID is correct in Campaign Manager.

Problem: Multiple conversion events firing for single form submission Solution: HubSpot sometimes fires multiple callbacks. Add a debounce function to your listener code. Wrap the dataLayer.push() in a timeout and clear previous timeouts:

let hubspotTimeout;
// In your event listener:
clearTimeout(hubspotTimeout);
hubspotTimeout = setTimeout(function() {
    dataLayer.push({
        'event': 'hubspot_form_submit',
        'form_id': event.data.id
    });
}, 100);

Problem: Forms on non-HubSpot domains not tracking Solution: The hsFormCallback method doesn’t always work on embedded forms. Focus on the addEventListener('message') approach for embedded forms. Also check that HubSpot’s embed code includes the callback functions.

Problem: LinkedIn reports conversions but timestamps don’t match form submissions Solution: This usually means LinkedIn is picking up other website events as conversions. Check if you have multiple conversion tags firing on the same trigger, or if your trigger is too broad (firing on page views instead of just form events).

Problem: Conversions only tracking on some forms but not others Solution: Different HubSpot forms may use different implementation methods. Some use progressive forms, some are embedded via iframe, some are native on HubSpot pages. Test each form type individually and adjust your listener code accordingly.

Problem: High variance between HubSpot and LinkedIn conversion counts (>20% difference) Solution: Check for ad blockers and tracking prevention. LinkedIn’s tracking is more easily blocked than HubSpot’s native form tracking. Also verify that all form submission paths are covered — mobile vs desktop, different form templates, popup forms vs inline forms.

What To Do Next

Once your HubSpot + LinkedIn tracking is working, consider these related setups:

Need help getting this setup right the first time? I offer free tracking audits where I’ll review your current implementation and identify what’s broken.

This guide is part of the LinkedIn Ads Conversion Tracking hub — complete setup guides for tracking any conversion source in LinkedIn Ads.