CRM Integration 8 min read

How to Pass Attribution Data to Your CRM (HubSpot, Salesforce & More)

SourceStream Team ·

Your CRM is the system of record for your leads and customers. It is where sales tracks deals, where marketing measures pipeline, and where leadership looks for revenue data. But if your CRM does not capture how each lead found you, it is missing the most important piece of the puzzle.

Marketing attribution data, the channel, campaign, source, and touchpoints that brought a lead to your door, should live in your CRM alongside every other data point about that lead. This article shows you how to make that happen with HubSpot, Salesforce, Pipedrive, and any other CRM that accepts form submissions.

Why Your CRM Needs Attribution Data

When attribution data lives in your CRM, you unlock several powerful capabilities:

  • Revenue attribution. When a deal closes, you can trace the revenue back to the original marketing channel and campaign.
  • Lead quality analysis. Compare close rates, deal sizes, and sales cycle lengths across different lead sources.
  • Sales context. Your sales team sees how a lead found you, what pages they visited, and what campaign brought them in, before the first call.
  • Reporting alignment. Marketing and sales work from the same data source, eliminating discrepancies between analytics and CRM reports.

The Hidden Form Field Method

The most reliable and universal method for getting attribution data into your CRM is the hidden form field approach. It works with any CRM and any form builder because it uses the existing form submission process, no API integrations required.

Here is the concept: you add invisible fields to your website forms. These fields are populated by a JavaScript snippet with attribution data captured from the visitor's session. When the form is submitted, the hidden field values travel alongside the visible form data into your CRM.

Step 1: Create Custom Properties in Your CRM

Before you add hidden fields to your forms, create the corresponding properties in your CRM to receive the data.

HubSpot: Go to Settings, then Properties, then Create Property. Create contact properties for each attribution field (use the "Contact information" group). Set the field type to "Single-line text."

Recommended properties to create:

  • attribution_source — The traffic source (google, facebook, linkedin)
  • attribution_medium — The traffic medium (cpc, organic, email, social)
  • attribution_campaign — The campaign name
  • attribution_channel — The broad channel category
  • attribution_landing_page — The first page the lead visited
  • attribution_gclid — Google Ads click identifier

Salesforce: Navigate to Object Manager, select Lead (or Contact), then Fields & Relationships, then New. Create custom text fields for each attribution data point. Repeat for the Opportunity object if you want to carry attribution through the pipeline.

Pipedrive: Go to Settings, then Data fields, then Add custom field. Create text fields under the Person or Deal categories.

Step 2: Add Hidden Fields to Your Forms

Add hidden input fields to each form on your website. The implementation varies by form builder:

HubSpot Forms: In the form editor, click "Add another field" and choose your custom attribution properties. Set them to "Hidden" in the field options. HubSpot forms automatically submit hidden fields to the corresponding contact properties.

Contact Form 7 (WordPress):

Add hidden fields to your form template:

[hidden attribution_source default:get]
[hidden attribution_medium default:get]
[hidden attribution_campaign default:get]
[hidden attribution_channel default:get]
[hidden attribution_landing_page default:get]

Gravity Forms (WordPress): Add Hidden Field types to your form. Set the field label to match your CRM property names. In the Advanced tab, set the Default Value to empty.

WPForms (WordPress): Add Hidden Field elements to your form. Name each field to correspond with your CRM properties.

Standard HTML Forms:

<input type="hidden" name="attribution_source" value="">
<input type="hidden" name="attribution_medium" value="">
<input type="hidden" name="attribution_campaign" value="">
<input type="hidden" name="attribution_channel" value="">
<input type="hidden" name="attribution_landing_page" value="">

Step 3: Populate Hidden Fields with Attribution Data

This is where the attribution script comes in. A JavaScript snippet needs to:

  1. Capture UTM parameters and referrer data when the visitor arrives
  2. Store that data in first-party cookies so it persists across pages and sessions
  3. Find hidden form fields on the page and populate them with the stored attribution data

SourceStream handles all three steps automatically. Install the script once, and it detects hidden fields in any form builder, populates them with the correct attribution data, and ensures the data is there when the form is submitted.

Step 4: Map Form Fields to CRM Properties

Ensure your form submissions route to the correct CRM properties:

HubSpot: If you are using HubSpot Forms, this mapping is automatic when you use HubSpot contact properties as hidden fields. If you are using external forms (Contact Form 7, Gravity Forms, etc.), configure the CRM connector or webhook to map each form field to the corresponding HubSpot property.

Salesforce: If using Web-to-Lead forms, the hidden field names must match your custom field API names. For third-party form submissions, configure field mapping in your integration tool (Zapier, native connector, etc.).

Pipedrive: Use Pipedrive's web forms or configure your form integration to map hidden fields to your custom data fields.

Step 5: Verify the Data Flow

After setup, submit a test form with UTM parameters in the URL. Check your CRM to confirm:

  • A new lead/contact was created
  • The attribution custom properties are populated with the correct values
  • The data matches the UTM parameters you used in the test URL

Run this test for each form on your site to ensure complete coverage.

Building Reports with Attribution Data

Once attribution data is flowing into your CRM, you can build reports that connect marketing activity to pipeline and revenue:

Leads by Channel

Group your leads by attribution_channel to see which channels drive the most volume. Compare with close rates to find your most efficient channels.

Campaign Performance

Group by attribution_campaign and measure leads generated, pipeline created, and revenue closed for each campaign. This gives you true campaign ROI.

Source Quality

Segment leads by attribution_source and measure average deal size, close rate, and time to close. Some sources might generate fewer leads but much higher-value deals.

Landing Page Effectiveness

Use attribution_landing_page to see which pages convert visitors into leads. Identify your best-performing pages and replicate what works.

Advanced: Multi-Touch Attribution in Your CRM

The hidden field approach described above captures the first-touch or most-recent attribution data. For true multi-touch attribution, you need to track multiple touchpoints per lead.

Here are two approaches:

  • First-touch and last-touch fields. Create two sets of attribution properties, one for the first visit and one for the converting visit. SourceStream can populate both sets automatically.
  • Activity timeline. Log each marketing touchpoint as an activity or note on the contact record, creating a complete history of interactions.

For most businesses, starting with first-touch attribution provides immediate, actionable insights. You can always layer on more sophisticated models as your tracking matures.

Start Flowing Attribution Data Today

Getting attribution data into your CRM is not a massive integration project. With SourceStream, the process is straightforward: install one script, add hidden fields to your forms, and map them to your CRM properties. In most cases, you can complete the entire setup in under 30 minutes.

Once the data is flowing, every lead in your CRM will have a complete attribution story. Your sales team will know how each lead found you. Your marketing team can prove which campaigns drive revenue. And your leadership will have the data they need to invest in what works.

Start tracking your lead sources today

SourceStream captures every marketing touchpoint and flows attribution data directly into your forms and CRM. Set up in under 5 minutes.

Try SourceStream Free for 14 Days

No credit card required