Lux Marketing

Email & Automation

Enriching the Data Layer with Mautic for Improved Personalization

How to put Mautic contact stage and points into your website’s dataLayer, and what to do with them in Google Tag Manager, GA4 and other tools.

Mautic, the open-source marketing automation platform, already scores your contacts and tracks their funnel stage. Put that data into your website’s dataLayer and Google Tag Manager (GTM) can use it to personalize pages, qualify conversions and segment reports.

Mautic adds stage and engagement to the dataLayer

The datalayer is essentially a data storage mechanism that holds structured information about a webpage and user interactions. It’s a valuable resource for various analytics and marketing tools, including Google Analytics and GTM.

The integration of Mautic enriches this datalayer with two critical types of data:

  1. Contact Stage: Indicates the user’s current phase in the marketing funnel. Mautic changes it through campaigns and point triggers as the contact acts, allowing you to tailor marketing campaigns that align with their journey.
  2. Contact Points: Reflects user engagement through points assigned for actions like website visits or form submissions. High contact points can trigger more personalized marketing messages.

The Mautic Contact Datalayer Plugin, included with a Mautic build, pushes both values into the dataLayer automatically.

A CDP can pick up Mautic data from the dataLayer in real time

Once you have Mautic data in the datalayer, you can further enhance your personalization efforts by pushing this data to a Customer Data Platform (CDP). By integrating Mautic data with a CDP, you can enrich customer profiles, enable cross-channel personalization, improve segmentation and targeting, and centralize data.

To push Mautic data from the datalayer to a CDP, you can utilize the APIs or integration tools provided by your chosen CDP platform, mapping the datalayer variables to the corresponding fields in your CDP and setting up automated data synchronization.

Contact data can decide when a conversion fires in GTM

Google Tag Manager (GTM) allows you to create campaign conversions based on specific conditions or triggers, and by leveraging Mautic contact data in the datalayer, you can set up campaign conversions that are triggered when certain contact-related conditions are met.

To use contact data as a condition for a campaign conversion in GTM, identify the relevant contact data points, create a GTM trigger that listens for changes in the datalayer, define the campaign conversion tag, configure the tag to send data to your preferred marketing or analytics platform, and test and publish your changes.

For example, fire a “qualified visit” conversion only for contacts above a points threshold, so ad platforms optimize toward engaged prospects rather than every visitor.

JavaScript can pass the same values to other tools

The Mautic data stored in the datalayer can be accessed and utilized in JavaScript, allowing you to integrate with other marketing tools such as HubSpot or Mailchimp. By retrieving the relevant contact data from the datalayer using JavaScript, you can pass this information to your chosen marketing platform’s API, enabling personalized and targeted communications.

For example, you can use JavaScript to retrieve a user’s contact stage or contact points from the datalayer and then use the HubSpot or Mailchimp API to trigger specific email campaigns, update contact properties, or create targeted segments based on that data.

GA4 can report behavior by stage and points range

You can also push Mautic data from the datalayer to Google Analytics 4 (GA4), and can gain valuable insights into user behavior based on their contact stage and contact points range. To achieve this, you can create custom dimensions in GA4 that correspond to the Mautic contact stage and contact points range.

By configuring your GTM tags to send these custom dimensions along with the relevant events, you can populate GA4 with the Mautic data. Once the data is flowing into GA4, you can create custom reports, segments, and explorations that analyze user behavior, engagement, and conversion metrics based on the contact stage and contact points range.

Personalization by stage works in most industries

  • Ecommerce: show product recommendations or offers based on the contact’s stage, and save discounts for highly engaged customers.
  • B2B SaaS: match demos, product tours and case studies to how familiar the visitor already is with your product.
  • Healthcare and wellness: show content that fits where the person is in their journey, and make scheduling easier for those ready to book.
  • Education and nonprofits: recommend courses, events or giving options based on engagement.

Stage and points data still has to follow privacy rules

Contact stage and points are tied to a known person, so treat them as personal information. Follow the privacy laws where you operate (for US businesses, state laws such as California’s CCPA): say in your privacy policy how the data is used, respect opt-outs and cookie choices, and let people access or delete their data. Keep names and email addresses out of the dataLayer and out of GA4.

Any other Mautic field can be added the same way

Stage and points cover most needs. If you need other Mautic fields in the dataLayer, they can be added with custom code as part of a Mautic build.

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.