Skip to content

How to Capture UTM Parameters in Drupal and Pass Them to Your CRM

If you want to know which campaigns, channels and pages actually produce leads and customers, the source of each form submission needs to be recorded alongside the contact details. This guide walks through the Drupal-side setup: tagging campaigns, adding hidden fields, persisting the values in a cookie and passing them into your CRM so reports can compare paid search, organic search, paid social and other channels.

Why source data belongs in the CRM

Growth decisions depend on knowing which marketing efforts produce leads and customers at a positive return. If the CRM only stores a name and an email, you can count submissions but not attribute them. Recording the source of every lead and opportunity lets you run reports on campaigns, content and channels, and then compare which ones are working.

The four-step Drupal setup

The workflow has four parts: tag the ads and campaigns, add hidden fields to the Drupal forms, let a capture layer fill those fields from a cookie, and pass the values into the CRM with the rest of the submission.

Step 1: Tag every campaign

Add UTM parameters to all ads and campaigns you run. That includes social platforms such as Facebook, LinkedIn, Twitter and Instagram, search engines such as Google and Bing, and bespoke placements such as trade publications, blogs or sponsored industry newsletters.

Step 2: Add six hidden fields to your Drupal forms

Create a way for the form to receive source data. Drupal form-building modules often let you drag a Hidden field onto the form, or a developer can add it in code. The form needs these six hidden fields: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page and Landing Page Group.

Worked example: a paid search visit

Imagine a visitor searches for "stream movies online" on Google, clicks a paid advertisement and later completes a signup form. Depending on the UTM parameters used, the hidden fields could receive: Channel = Paid Search; Channel Drilldown 1 = Google; Channel Drilldown 2 = Movies Campaign; Channel Drilldown 3 = Free Trial Ad. The landing page information could be recorded as Landing Page = www.netflix.com/features/movies and Landing Page Group = Features. This example is illustrative, not a customer result.

Step 4: Send the values into the CRM

When the lead submits the form, the hidden-field values are recorded with the name, email and other details the lead entered. That record can then be sent into a CRM such as Salesforce, Pipedrive or HubSpot. Once the data is there, reports can answer questions such as how many leads came through Facebook ads, how many customers Google Ads brought in, or how much revenue SEO efforts generated.

What the capture layer does

A capture layer is a snippet of code on the site that examines technical information about how a visitor arrived. It sorts visitors into channels such as Paid Search, Organic Search and Paid Social, saves that information in a cookie, and later uses the cookie to complete the hidden fields when a form is submitted. The data then travels into the CRM and other tools. This section describes the general mechanism of a cookie-based capture layer; it is not a statement about who owns or built any particular product.

Raw UTM capture versus normalized channel data

Capturing raw UTM strings is not the same as producing clean channel data. A raw approach can leave you with inconsistent values — for example, some campaigns tagged UTM Source = Google and others tagged UTM Source = Adwords — which then appear as two separate sources in the CRM and have to be stitched together. A normalization layer accounts for capitalization and similar inconsistencies and classifies both as Paid Search.

All traffic, not only tagged traffic

A capture layer can record channels that never carry UTM parameters, including Organic Social, Organic Search, Direct and Referral, as well as the paid channels you have tagged. That gives a fuller picture of what drives leads and customers, rather than only the campaigns that were tagged.

Why cookie persistence matters

Some capture methods require the UTM parameter to be present on the page where the form is completed. That breaks when the visitor lands on a campaign page, browses further and then fills a quote request form on a different page. Storing the values in a cookie means the original UTM parameters are still available whenever the form is finally submitted, no matter how many pages the visitor viewed in between.

Landing page and landing page group

Beyond UTM parameters and channel data, a capture layer can record the landing page and a landing page category. This makes it possible to see how a blog or a content group performs as a whole, as well as how individual pages and pieces of content perform.

Decision checklist before you build

Use this checklist to separate the three jobs that are often confused:

  1. Capture — are the UTM values read on arrival and stored somewhere that survives navigation?
  2. Normalize — are raw values mapped to consistent channels, so Google and Adwords do not become two sources?
  3. Deliver — do the six hidden fields reach the CRM with the form submission, alongside name and email?

If any one of the three is missing, the CRM report will either undercount leads or require manual stitching.

Frequently asked questions

Which hidden fields does the Drupal form need?

Six: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page and Landing Page Group. Drupal form-building modules can add them by drag-and-drop, or a developer can add them in code.

What happens if the visitor fills the form on a different page from the ad landing page?

With cookie-based capture, the original UTM parameters are still available when the form is submitted. Methods that rely on the UTM parameter being present on the form page lose the data once the visitor navigates away.

Why do Google and Adwords show up as two sources in my CRM?

Raw UTM strings are passed through as written. If some campaigns use UTM Source = Google and others use UTM Source = Adwords, the CRM sees two values. A normalization layer classifies both as Paid Search.

Can I attribute leads that arrive without UTM parameters?

Yes, with a capture layer that classifies all traffic. Organic Search, Organic Social, Direct and Referral can be recorded alongside tagged paid channels.