+42%
End-to-end attribution: Google Ads → CRM → Sheets
End-to-end lead tracking from click to CRM: Contao + HubSpot + Google Sheets (Germany)
This case study is for you if...
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
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.
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.
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.
What was done
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.
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.
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.
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
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.
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.
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
Before and after
In simple terms, managers can now see which campaign every lead came from, with no follow-up questions and no manual copying.
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
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.