Hello,
I’ve been encountering an issue with my Mautic setup where I’m attempting to identify users and associate specific URL parameters (in this case, ‘email’) with contact attributes.
Here’s the code I’ve been using:
(function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://mydomain.com/mtc.js','mt');
var urlParams = new URLSearchParams(window.location.search);
var email = urlParams.get('email');
var pageParams = {};
if (email) pageParams.email = email;
if (Object.keys(pageParams).length > 0) {
mt('send', 'pageview', pageParams);
} else {
mt('send', 'pageview');
}
Despite using this script, Mautic is not associating the ‘email’ URL parameter with the contact’s attributes as I would expect. I have ensured that the ‘email’ field exists in Mautic and matches the case of the parameter I’m passing.
Additionally, I’ve attempted to test this on different devices and outside of my Mautic browser session, but I have encountered the same problem on all of them.
Could you please provide some assistance or point me in the right direction to resolve this issue?
Thank you in advance for your help!