Sending data to the GTM Datalayer
Discover how to push A/B testing and personalization variables from Umbraco Engage to the Google Tag Manager (GTM) data layer in Razor templates.
@Html.Partial("~/Views/Partials/Umbraco.Engage/GTMDataLayerPush.cshtml")<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
inabtest: true,
abtestname: "The name of the AB test",
personalized: true,
personalizationname: "The name of the personalized variant",
});
</script>Last updated
Was this helpful?