# Multiple anonym contacts for same visitor (even after identifying him)

**URL:** <https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094>\
**Category:** Product Support\
**Tags:** mautic-3\
**Created:** [April 20, 2021, 1:20pm UTC](https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094 "2021-04-20T13:20:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![imihandstand](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imihandstand/32/1499_2.png) [@imihandstand](https://forum.mautic.org/u/imihandstand)\
**Post date:** [April 20, 2021, 1:20pm UTC](https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094/1 "2021-04-20T13:20:18Z")

</div>

**Your software**  
My Mautic version is: 3.2.5 and 3.3.2  
My PHP version is: 7.3.27

**Your problem**  
When a visitor visits multiple pages of my website, Mautic creates multiple anonym contacts for him. Even after identifying him via Email, Mautic still creates multiple new anonym contacts for every page he visits.

I tested on multiple browsers. The issue is in **Opera** and **Safari** , but not in Firefox, Chrome, Microsoft Edge, Internet Explorer and Firefox Android

**Steps I have tried to fix the problem:**  
I tested multiple browsers, turned “Anonymize IP” on and off, subscribed via my forms, etc. Tested for 5+ hours.

Please help me, because at the moment Mautic is useless this way - many new subscriber are unable to complete the double-optin process, so I lose many new leads.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 20, 2021, 3:22pm UTC](https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094/2 "2021-04-20T15:22:25Z")

</div>

Hi,  
Could you reproduce it yourself?  
How did you deal with the cookie?  
Did you use secret mode?  
Thx,  
J

---

<div class="post-metadata">

**Author:** ![imihandstand](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imihandstand/32/1499_2.png) [@imihandstand](https://forum.mautic.org/u/imihandstand)\
**Post date:** [April 20, 2021, 4:04pm UTC](https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094/3 "2021-04-20T16:04:53Z")

</div>

> [@joeyk](#):
>
> Could you reproduce it yourself?

I have these information based on my own tests. So yes.

> [@joeyk](#):
>
> How did you deal with the cookie?

Not sure what you mean, I didn’t do anything with the cookies. And in all browsers cookies were activated.

> [@joeyk](#):
>
> Did you use secret mode?

You mean if I tried private mode in browsers? Yes, I tried that too, same issue.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 20, 2021, 4:42pm UTC](https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094/4 "2021-04-20T16:42:31Z")

</div>

I’m just asking, because it is really hard to test. And you rely on your own test, so if you do it wrong, you might think there is something wrong with Mautic. I would like to give you some tips:

Known/Unknown visitors are tracked by cookies. Cookies only have reliable access if they are first party cookies, which means your Mautic install domain should be a subdomain of the website you’d like to track. Otherwise it’s handled as third party cookie and the browsers will punish you for that, especially Safari.

Once you login as admin, you get an admin designation, that is saved. It means, that certain functions will work differently for you. You won’t be tracked for example. Or see dynamic content nor focus items. This also shows problems with understanding what doesn’t work.

If you check Mautic with privacy mode, then no cookies will be used, so you might be tracked as a new person every time you check the website.

Also make sure you use https in all cases.

I have to mention, that browser based tracking works really well. However there are issues with API + Browser tracking combination, but that is not what you subscribed.

I hope this helps.

Joey

---

<div class="post-metadata">

**Author:** ![imihandstand](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imihandstand/32/1499_2.png) [@imihandstand](https://forum.mautic.org/u/imihandstand)\
**Post date:** [April 20, 2021, 5:56pm UTC](https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094/5 "2021-04-20T17:56:35Z")

</div>

- I checked now in Mautic **7-8 real subscribers** and plenty of them had this issue, that every page-view created a new visitor in Mautic for them. The big problem with this is, that even if they confirm their email-address (double-optin), this doesn’t get recognized - so they stay unconfirmed and I can’t send them new emails.

- I always have **“Identify visitor by tracking url”** on ‘Yes’, so cookies can’t be the (only?) problem. Because when somebody submits my optin-form and clicks on the link which he gets via email, the visitor-ID should be in the tracking-url, shouldn’t it?  
Plus, for testing-purposes, I turned on **“Identify visitors by IP”** (normally I don’t track IP’s), and even so this issue exists.

- Sure, I do just use **HTTPS**

- I think I don’t use the **API** , just normal Javascript

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 21, 2021, 3:56am UTC](https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094/6 "2021-04-21T03:56:11Z")

</div>

1. You can track clicks instead of page visits when they confirm. Clicks are not tracked using cookies.
2. You didn’t answer about first/third party tracking.
3. Do you use any firewall?

---

<div class="post-metadata">

**Author:** ![imihandstand](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imihandstand/32/1499_2.png) [@imihandstand](https://forum.mautic.org/u/imihandstand)\
**Post date:** [April 21, 2021, 9:45pm UTC](https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094/9 "2021-04-21T21:45:35Z")

</div>

After 4 days of testing, I solved it.

**There were 2 problems:**  
1.) Some browsers (like Safari) forbid cross-site tracking regarding cookies  
2.) The " _Identify visitor by tracking url_ " feature of Mautic doesn’t seem to work correctly

**How I solved it:**  
…By telling Mautic which email-address that “new visitor” is. For this, 2 things are needed:

- The **link " _Click here to confirm your email-address_ "** in the email " _Please confirm your email-address_ " must contain the **email-token** (so the link will be like [website.com/confirmed?email=](http://website.com/confirmed?email=)[example@example.com](mailto:example@example.com) )
- **Mautic’s Javascript-tracking-code** must contain this:  
`mt('send', 'pageview'<?php if ($_GET["email"]) { echo ", { , 'email': '" . $_GET["email"] . "'}"; } ?> );`  
…instead of just this:  
`mt('send', 'pageview');`

**So the script gets the Email-Address from the URL and helps so Mautic to correctly identify the visitor.**

Thank you very much [joeyk](https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094/6) - your question regarding third-party-tracking helped me to solve this! 🙂

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 22, 2021, 8:24am UTC](https://forum.mautic.org/t/multiple-anonym-contacts-for-same-visitor-even-after-identifying-him/19094/10 "2021-04-22T08:24:23Z")

</div>

Hey, you are welcome, you solved it yourself. Good job and thx for posting the solution.  
I would like to mention, that you can serve first party cookies the following way (I had a tutorial about this in the forum, but can’t find it now.)

Lets say you want to track:  
domain1  
domain2  
domain3

1. Install Mautic on “[mautic.domain1.com](http://mautic.domain1.com)”
2. Set CNAME t.domain2 [mautic.domain1.com](http://mautic.domain1.com)
3. Set CNAME t.domain3 [mautic.domain1.com](http://mautic.domain1.com)

This way [t.domain2.com](http://t.domain2.com) points at [mautic.domain1.com](http://mautic.domain1.com)

Now add the following tracking to DOMAIN2 (and also to DOMAIN3)

```
<script>
(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://t.domain2.com/mtc.js','mt');
mt('send', 'pageview');
</script>

```

Voilá, you are serving first party cookies 🙂
