Unable to Associate URL Parameters with Contact Attributes in Mautic


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:


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!

Not sure if this is related - but I have a similar problem: Updating contact via /mtc/event - #7 by dirk_s it looks like those mechanisms (via tracking JS) only rely on the identity stored in the cookie. It would indeed be good to use it as well for manually setting the concerned ID via parameter - instead of the cookie.

Had a look. similar type of issue.

But I am just trying to associate the users email and name via the url ( Website Domain Names, Online Stores & Hosting - Domain.com ) in mautic and then tracking and triggering the automations.

I followed the tracking to a tee and tried various was to go about this…

Did some more testing, using the example event with company details in the tracking detail document

    mt('send', 'pageview', {email: 'my@example.com', firstname: 'John', company: 'Mautic', companyemail: 'mautic@example.com', companydescription: 'description of company', companywebsite: 'https://example.com', tags: 'addThisTag,-removeThisTag', utm_campaign: 'Some Campaign'});

I was able to associate company, tags, utm_campaigns, companyemail…

but not the firstname, email

I also tried doing it via the pixel and was not successful

Any feedback guys?

Who knows if this is it, but I came across your post in my hair pulling search…

If you are logged into mautic on your machine and also trying to track yourself in the same browser… Mautic WILL NOT UPDATE your user. You need to use an incognito tab to test.

Are those fields set to be “publicly updatable”? Per default they are not.