# Mautic overrides the existing contact

**URL:** <https://forum.mautic.org/t/mautic-overrides-the-existing-contact/8695>\
**Category:** Product Support\
**Created:** [June 9, 2017, 5:30am UTC](https://forum.mautic.org/t/mautic-overrides-the-existing-contact/8695 "2017-06-09T05:30:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sivananda\_Perumal](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sivananda\_Perumal](https://forum.mautic.org/u/Sivananda_Perumal)\
**Post date:** [June 9, 2017, 5:30am UTC](https://forum.mautic.org/t/mautic-overrides-the-existing-contact/8695/1 "2017-06-09T05:30:14Z")

</div>

Hi,  
  
  
  
Thanks for this wonderful automation tool. I’m new to mautic. I have 3 websites and I just want to track all the site users in my mautic.  
  
  
  
So, I have put the trackingJS code into my 3 sites. Whenever the user is logged in I want to track those events in the mautic.  
  
  
  
My tracking JS code is:  
  
(function(w,d,t,u,n,a,m){w=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](https://mydomain.com/mtc.js','mt)’);  
  
  
  
Whenever the user is logged in this code will trigger  
  
mt(‘send’, ‘pageview’, {email:loggedInEmail, firstname:loggedInName});  
  
  
  
Then I did this, I logged into my site with email [abc@gmail.com](mailto:abc@gmail.com) and logged out then again I logged with [xyz@gmail.com](mailto:xyz@gmail.com) on the same browser.  
  
  
  
What happens is when [abc@gmail.com](mailto:abc@gmail.com) is logged in new user is created in the mautic. And [abc@gmail.com](mailto:abc@gmail.com) is logged out, then the login of [xyz@gmail.com](mailto:xyz@gmail.com) is overriding the data of [abc@gmail.com](mailto:abc@gmail.com) in mautic.  
  
  
  
Why is that so happening? I think this is happening due to the mautic cookie data on the site.  
  
  
  
Using  
  
  
  
Mautic -\> 2.81v  
  
Php -\> 5.6  
  
Step to reproduce:  
  
  
  
Add the trackingJS Code on the website.  
  
Try to send the logged in user details to mautic.  
  
it will override the first logged in user when you attempt to login with other emails.  
  
Awaiting for your response !!!

---

<div class="post-metadata">

**Author:** ![Sivananda\_Perumal](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sivananda\_Perumal](https://forum.mautic.org/u/Sivananda_Perumal)\
**Post date:** [June 9, 2017, 5:30am UTC](https://forum.mautic.org/t/mautic-overrides-the-existing-contact/8695/2 "2017-06-09T05:30:14Z")

</div>

Hi,

Thanks for this wonderful automation tool. I’m new to mautic. I have 3 websites and I just want to track all the site users in my mautic.

So, I have put the trackingJS code into my 3 sites. Whenever the user is logged in I want to track those events in the mautic.

My tracking JS code is:  
(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](https://mydomain.com/mtc.js','mt)’);

Whenever the user is logged in this code will trigger  
mt(‘send’, ‘pageview’, {email:loggedInEmail, firstname:loggedInName});

Then I did this, I logged into my site with email [abc@gmail.com](mailto:abc@gmail.com) and logged out then again I logged with [xyz@gmail.com](mailto:xyz@gmail.com) on the same browser.

What happens is when [abc@gmail.com](mailto:abc@gmail.com) is logged in new user is created in the mautic. And [abc@gmail.com](mailto:abc@gmail.com) is logged out, then the login of [xyz@gmail.com](mailto:xyz@gmail.com) is overriding the data of [abc@gmail.com](mailto:abc@gmail.com) in mautic.

Why is that so happening? I think this is happening due to the mautic cookie data on the site.

Using

Mautic -\> 2.81v  
Php -\> 5.6  
Step to reproduce:

Add the trackingJS Code on the website.  
Try to send the logged in user details to mautic.  
it will override the first logged in user when you attempt to login with other emails.  
Awaiting for your response !!!

---

<div class="post-metadata">

**Author:** ![Sivananda\_Perumal](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sivananda\_Perumal](https://forum.mautic.org/u/Sivananda_Perumal)\
**Post date:** [June 15, 2017, 3:46am UTC](https://forum.mautic.org/t/mautic-overrides-the-existing-contact/8695/3 "2017-06-15T03:46:54Z")

</div>

@kuzmany I think we can’t able to clear the mautic cookies from our website.

---

<div class="post-metadata">

**Author:** ![jserpa](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@jserpa](https://forum.mautic.org/u/jserpa)\
**Post date:** [September 22, 2017, 9:35am UTC](https://forum.mautic.org/t/mautic-overrides-the-existing-contact/8695/4 "2017-09-22T09:35:49Z")

</div>

I am having the same problem.

Is it possible to be solved without changing Mautic’s code?

---

<div class="post-metadata">

**Author:** ![namratasaun](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/namratasaun/32/2801_2.png) [@namratasaun](https://forum.mautic.org/u/namratasaun)\
**Post date:** [December 10, 2020, 4:40pm UTC](https://forum.mautic.org/t/mautic-overrides-the-existing-contact/8695/5 "2020-12-10T16:40:33Z")

</div>

any update on this?  
I am stuck with the same problem
