Lux Marketing

Email & Automation

How to Use Mautic Variables in URLs to Maintain Email Click Tracking

Mautic, the open-source marketing automation platform, tracks email clicks by routing each link through a redirect. That redirect can cost you data: some link scanners and inbox providers treat redirect links with suspicion, and query parameters can get stripped along the way. Putting Mautic variables directly into your URLs keeps the information you need in the link itself.

Mautic variables insert each contact’s data into an email

Mautic variables (tokens) are placeholders that Mautic replaces with each contact’s data when the email is sent. Contact field tokens use single curly braces with the field’s alias, for example {contactfield=firstname}. The token list in the email builder shows the exact alias for each field.

A token in the link carries the contact’s identity to your site

  1. Pick an identifier: use a non-personal identifier, such as a custom ID field, rather than the email address, so personal data doesn’t end up in your analytics or server logs.
  2. Add it to the link: write the token into the URL along with your UTM parameters.
  3. Read it on your site: capture the parameter (for example, as a GTM variable) and pass it to your analytics or CRM with the visit.
https://www.example.com/offer/?utm_source=mautic&utm_medium=email&cid={contactfield=YOUR_ID_FIELD}

Replace YOUR_ID_FIELD with the alias of the field that holds the identifier.

Once the visit carries that identifier, store it in a first-party cookie and you can tie it to the contact’s later visits on your site, even when they come back without filling in a form, and use it for reporting and personalization.

Julio Lopez
About the author

Julio Lopez · Founder & Head of Growth, Lux Marketing

Julio has spent 12+ years in paid media and analytics, and founded Lux in 2018. He has worked with 30+ clients across six industries, from DTC brands and premium wineries to a history museum. As Head of Growth at Glossi, he built the tracking and AI lead scoring behind twice the sign-ups the sales team produced, and he still writes the tracking code himself.

Julio on LinkedIn

Your email automation can run on the platform that fits your list and your stack.

Email builds run on Mautic, Klaviyo or HubSpot: the flows, the segments and the sending setup, tied to real behavior data. Self-hosted Mautic has no per-contact fees. Applying takes two minutes, and Julio reviews every application.