Mautic is creating a new ID with every page load for anonymous users

My PHP version is : 7.4.16
My MySQL/MariaDB version is: 10.3.28-MariaDB

I am: Updating from 3.3 to 4.3
Upgrading via : Command Line

My problem is:
After my upgrade, anonymous users are given a new Mautic ID with each page hit. I can see this when I travel through my site and when I refresh the Contacts page, I receive a new Mautic ID for each page. I can also see it when I look at the mtc_id in my dev tools for the page. Each page I go to, this value changes. Because of this everything is segmented. Anytime someone fills out a form, I can’t see any other actions they have been given a new Mautic ID and all their previous activity is associated with other IDs. This makes most campaigns and segments fail.

Steps I have tried to fix the problem :
php app/console mautic:contacts:duplicate

I’ve confirmed that the tracking code is correct.

Going to a different install that hasn’t been upgraded yet, my anonymous page hits are grouped together as expected.

I had the same issue and couldn’t find a good solution. I ended up creating a “Campaign” to delete these empty records each day.

Hi,
There are 3 options here:

  1. Your tracking is not set up properly and as a result anon contacts are not merged. This happens if you don’t use SSL or your tracking pixel communication is limited by cors issue.

  2. You do have a huge traffic from people interested in your product. You should embrace them.

  3. Bots are swarming your site. You need to try to clear them out and creating a webserver rule:

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule .* - [F,L]

This doesn’t let anyone see your page without a user agent set up. This is very often in case of bots.

I have a guide about it:

1 Like

@tke852
The only thing I had to do is to change the setting show on the image and this was fixed:


Can you try if it helps for you too and let us know?

Hello everyone. I believe I was somewhat mistaken in how the tracking was working. I have found out that if you are logged in as an admin and are navigating around your site from a different tab, it seems to assign a new ID for every page load. But, if I use my cell phone after turning off WiFi, it seems to be tracking me correctly. I believe I do have some bot traffic causing some anomalies, but this is not the norm.

I am also submitting forms using an ajax call rather than using the standard form action or iframe provided by Mautic because they don’t really work aesthetically with my site. This does cause my visitors submitting forms to be added as a separate visitor id as well as a separate “IP ID” in the database backend. @joeyk helped me by sharing a script that looks at IP traffic within a short timeframe and combines them as a single lead.