# Unable to Associate URL Parameters with Contact Attributes in Mautic

**URL:** <https://forum.mautic.org/t/unable-to-associate-url-parameters-with-contact-attributes-in-mautic/28091>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [May 20, 2023, 3:07pm UTC](https://forum.mautic.org/t/unable-to-associate-url-parameters-with-contact-attributes-in-mautic/28091 "2023-05-20T15:07:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudy72](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rudy72](https://forum.mautic.org/u/rudy72)\
**Post date:** [May 20, 2023, 3:07pm UTC](https://forum.mautic.org/t/unable-to-associate-url-parameters-with-contact-attributes-in-mautic/28091/1 "2023-05-20T15:07:05Z")

</div>

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:

```auto
(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!

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [May 20, 2023, 3:37pm UTC](https://forum.mautic.org/t/unable-to-associate-url-parameters-with-contact-attributes-in-mautic/28091/2 "2023-05-20T15:37:30Z")

</div>

Not sure if this is related - but I have a similar problem: [Updating contact via /mtc/event - #7 by dirk\_s](https://forum.mautic.org/t/updating-contact-via-mtc-event/27970/7) 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.

---

<div class="post-metadata">

**Author:** ![rudy72](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rudy72](https://forum.mautic.org/u/rudy72)\
**Post date:** [May 20, 2023, 5:45pm UTC](https://forum.mautic.org/t/unable-to-associate-url-parameters-with-contact-attributes-in-mautic/28091/3 "2023-05-20T17:45:13Z")

</div>

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](http://domain.com/?email=john@doe.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…

---

<div class="post-metadata">

**Author:** ![rudy72](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rudy72](https://forum.mautic.org/u/rudy72)\
**Post date:** [May 20, 2023, 6:40pm UTC](https://forum.mautic.org/t/unable-to-associate-url-parameters-with-contact-attributes-in-mautic/28091/4 "2023-05-20T18:40:25Z")

</div>

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

```auto
    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

---

<div class="post-metadata">

**Author:** ![rudy72](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rudy72](https://forum.mautic.org/u/rudy72)\
**Post date:** [May 21, 2023, 5:19am UTC](https://forum.mautic.org/t/unable-to-associate-url-parameters-with-contact-attributes-in-mautic/28091/5 "2023-05-21T05:19:26Z")

</div>

Any feedback guys?

---

<div class="post-metadata">

**Author:** ![muldersc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/muldersc/32/6471_2.png) [@muldersc](https://forum.mautic.org/u/muldersc)\
**Post date:** [February 21, 2024, 4:45am UTC](https://forum.mautic.org/t/unable-to-associate-url-parameters-with-contact-attributes-in-mautic/28091/6 "2024-02-21T04:45:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [February 26, 2024, 8:21pm UTC](https://forum.mautic.org/t/unable-to-associate-url-parameters-with-contact-attributes-in-mautic/28091/7 "2024-02-26T20:21:50Z")

</div>

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

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/dc6726e601978c4957667e354ca5156f846c69e8.png)
