🎁 Free consultation. Book now. 🆕 New service: GEO optimization for AI search engines 📝 New blog post
Case Study

This business was spending thousands of euros on Google Ads in Germany and still could not tell which campaign had generated a single lead. UTM tags were lost, managers could not see the source, and data was copied by hand. Now attribution is 100% and manual source checks are down to zero.

End-to-end attribution: Google Ads → CRM → Sheets

End-to-end lead tracking from click to CRM: Contao + HubSpot + Google Sheets (Germany)

🇩🇪 Germany 🔗 Contao CMS 📊 HubSpot + Google Sheets
🔗
100%
Lead attribution visibility
100% attribution
0 manual requests

This case study is for you if...

🇩🇪 B2B business using Google Ads You are running Google Ads, but the CRM does not show which campaign the lead came from
🔗 CRM exists, but without attribution UTM parameters disappear when users move between pages on the website
📊 UTM values get lost between pages Managers are forced to ask customers manually how they heard about you
📝 Manual data copying Form data is copied into spreadsheets manually, which is slow and error-prone

See yourself in this? Keep reading: this case study shows the solution.

About the project

🇩🇪

A business running Google Ads in the German market

A business running Google Ads in the German market. The site is built on Contao CMS and the CRM is HubSpot. The goal was full visibility into which campaigns actually generated leads.

🔥

Challenge

There was no link between a Google Ads click and a CRM lead. UTM parameters were lost as users moved between pages, and managers could not see the lead source in the contact record.

🎯

Goals

01 Build a reliable data flow from click to CRM
02 Store utm_*, gclid, and gbraid for every lead
03 Automatically export leads to Google Sheets

What can go wrong here

And why most contractors get it wrong

UTM values disappear during navigation

A user clicks an ad with UTM parameters, moves to another page, and the parameters are lost. The form is submitted without the source, and the manager has no idea where the lead came from.

How I solved it: Store UTM values in cookies and localStorage, then inject them into hidden form fields

The CRM does not store advertising data

HubSpot does not include fields for utm_*, gclid, or gbraid by default. Without custom contact properties, attribution is impossible even if the data exists on the site.

How I solved it: Create contact properties for utm_* values and click IDs with correct form field mapping

Manual export means delays and mistakes

Copying data from the CRM into Google Sheets by hand leads to delays, missed leads, and errors. The marketer gets reports too late and makes decisions on stale data.

How I solved it: Use a HubSpot workflow to export a row to Google Sheets on every form submission

What was done

STEP 01

HubSpot data model

Created HubSpot contact properties for utm_* values and click IDs, mapped form fields correctly, and unified the setup across multiple forms and pages.

STEP 02

Parameter persistence script for Contao

Captured parameters from the URL, stored them in cookies and localStorage across pages, and injected them into hidden form fields before submit.

STEP 03

Automatic export to Google Sheets

Built a HubSpot workflow triggered by form submission that creates a new Google Sheets row, with column mapping to contact properties and enrollment logic control.

STEP 04

Data quality control

Ran test visits with parameterized URLs and test submissions, then verified values in HubSpot contact records and Google Sheets.

What I did differently

1

Start from the CRM model, not the script

I started with the HubSpot data model by creating custom contact properties for every UTM and click ID. Only after the model was ready did I write the Contao script. That avoided the classic situation where the data exists but there is nowhere to store it.

2

Persisting parameters between pages

The script stores utm_*, gclid, and gbraid in cookies and localStorage on the first visit. On form submit, it injects them into hidden fields. It still works even if the user visits five pages before converting.

3

Automation instead of manual work

The HubSpot workflow automatically creates a Google Sheets row for every form submission. The marketer sees the data in real time, without delays or manual copying.

Numbers that speak for themselves

100%
Attribution visibility
0
Manual source lookups
Solution scalability

Before and after

UTM Lost
100% cookies + localStorage
CRM Without attribution
Full HubSpot + custom properties
Export Manual
Auto HubSpot → Google Sheets
Scalability Limited
Any number of forms
What this means for the business
100%
attribution of every lead to a campaign
0
manual source checks per lead

In simple terms, managers can now see which campaign every lead came from, with no follow-up questions and no manual copying.

Free resource

Guide: how to preserve UTM parameters between website pages

A step-by-step guide for keeping UTM parameters and click IDs between pages. Works with any CMS and CRM.

  • PDF, 4 pages: ready-to-use script
  • CRM + Google Sheets integration diagram
  • No signup, no spam
Get it via Telegram →
PDF
UTM persistence and attribution guide
3 pages PDF • 420 KB
FREE

FAQ

How do you preserve UTM parameters between website pages?

You need a script that stores utm_*, gclid, and gbraid in cookies or localStorage on the first visit. On form submit, it injects them into hidden fields. In this case, that solved the attribution-loss problem on a Contao CMS site.

How do you set up automatic lead export from HubSpot to Google Sheets?

Use a HubSpot workflow triggered by form submission, with an action that creates a Google Sheets row. You need correct mapping from contact properties to spreadsheet columns and proper enrollment logic.

Does this attribution setup work with CMS platforms other than Contao?

Yes. The principle is universal: store the parameters in cookies or localStorage, inject them into hidden fields, and pass them to the CRM. I have used the same approach with WordPress, Contao, and Shopify.

Ready for growth?

Let's discuss your project and find the solution that works for your business.