Ghost contact IDs

Your software
Mautic version v2.15.2
PHP version 7.1.30
Browser Chrome

Your problem
My problem is:

Hundreds of Ghost contact IDs are being generated nearly every day in my Mautic installation due to an unknown reason, even though in the contact list there’s only 84 registered contacts.

The “ghost IDs” are just that, no new contact is actually created every time this happens.

I originally thought it had something to do with a bad cron job but as you can see in the image, the days when this problem occurs seem to be pretty irregular.

My setup: Installed Mautic in its own server and connected it to a Wordpress website (via OAuth 2) with a plugin called Thrive Leads. The lead capture forms work fine in my website and all the users who opt-in get instantly added to my contact list in Mautic.

Some days nobody registers through my form but whenever a new user does register, they get an ID that’s sometimes a hundred of values ahead of what it should be.

i.e Contact A gets ID 3, then Contact B registers two days later and gets ID 76.

I’ve not been able to figure out what’s causing it this problem. But I suspect it’s something to do with my Mautic installation rather than the wordpress plugin I’m using.

These errors are showing in the log:

[2019-11-07 07:38:31] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\ClassNotFoundException: “Attempted to load class “XmlEncoder” from namespace “Symfony\Component\Serializer\Encoder”. Did you forget a “use” statement for another namespace?” at /opt/bitnami/apps/mautic/htdocs/vendor/friendsofsymfony/rest-bundle/FOS/RestBundle/Decoder/XmlDecoder.php line 30 {“exception”:"[object] (Symfony\Component\Debug\Exception\ClassNotFoundException(code: 0): Attempted to load class “XmlEncoder” from namespace “Symfony\Component\Serializer\Encoder”.\nDid you forget a “use” statement for another namespace? at /opt/bitnami/apps/mautic/htdocs/vendor/friendsofsymfony/rest-bundle/FOS/RestBundle/Decoder/XmlDecoder.php:30)"}

Steps I have tried to fix the problem:

Checked the cron jobs but nothing there seems to be causing this.

I will truly appreciate your help.

Are these anonymous contacts?

Hi thanks for replying. I’m not sure what you mean by anonymous contacts. In my contact list there are only 84 contacts in total which registered through the form in my website. As an example, the ID of the last one is 4336 instead of 84, because for some unknown reason empty contact IDs are getting added without anyone having to interact with my form. When people actually fill the form a new contact is indeed generated.

https://www.mautic.org/docs/en/contacts/index.html

Contact Types

There are two types of contacts:

  • Visitors (formerly anonymous leads) — visitors to your site who have not yet been identified by a form or other interaction.
    • These contacts are tracked by Mautic but typically remain hidden so as not to clutter your segment.
  • Standard contacts — contacts which have identified themselves via a form or some other source. As a result, these contacts typically have a name, email, and other identifying fields.

Visitors (formerly anonymous leads)

Anonymous leads were renamed to visitors in Mautic 1.4.0.

You can view visitors by using the ‘table view’ (use the “t” keyboard shortcut to view contacts in a table or “c” as cards) within the contacts section.

Visitors are worth tracking, because these could be future customers. By tracking them before they have any interaction, you can retain a log of when they visited your site, which allows you to get a picture of their activity prior to engaging with you.

1 Like

Okay thanks I admit I didn’t know that. I checked and indeed those “Ghost IDs” I’m mentioning are actually anonymous contacts. But since by default they are hidden from the contact list I never knew about it.

So I typed “is:anonymous” in the filter field and I got a result of “4546 items, 152 pages in total”… makes sense now.

My only question now is, how can I disable this functionality in Mautic? I don’t really want to track visitors, I only want to keep identified contacts.

These anonymous contacts are taking up IDs and space in my database (and also possibly causing server overload), and most of them are bots and/or coming from the same IP over and over (see image):

Honestly I don’t need this feature in Mautic, that is why I want to disable it.

In my website I already have a solution that keeps traffic logs from visitors in a very efficient way, so I don’t really need Mautic to do that for me.

I only want Mautic to track identified contacts and disable anonymous contacts. Is this possible?

1 Like

The documentation is there for a reason. People have volunteered hundreds of man-hours for your benefit.

=====

Remove the mtc.js tracking script from your site(s). However, when you do that, you can’t track most things, Mautic-related, that your standard contacts perform on your site(s). You’ll have to figure out a custom 404 redirect for your web server as well so those visitors don’t hit any Mautic 404 pages by mistake (404 visitor problem is fixed in the next Mautic update).

You’ve essentially done this to Mautic.

We all know how well that turned.

1 Like

Yes, my bad, I think I also had a misunderstanding of this feature.

Turns out all of these anonymous contacts/visitors are coming not from my website nor my form there, but rather they are bots trying to access non-existent (404) pages in the IP of the server that I’m using to host Mautic.

http://servers-ip/TP/public/index.php

 http://servers-ip/phpMyAdminn/index.php

http://servers-ip/admin/phpmyadmin2/index.php

And hundreds of other requests like these.

They all return a 404 not found error yet it seems Mautic does register the IPs as a legit anonymous visitor. So from what I got by reading your answer, it means this specific problem is going to be solved in the next version of Mautic? That’d be awesome. :slight_smile:

P.S. Is there a way I can protect my mautic server from malicious requests like these? In my main website I solved it (partially) by installing a WAF but it relies on Wordpress to work… Is there some utility I could install in the server that’s running mautic? Debian 4.9

Create a blank file named custom404.html.

Uploaded it to your server root directory.

Add ErrorDocument 404 /custom404.html to your Apache web server config or root .htaccess file.

Add error_page 404 /custom404.html; if using the Nginx web server.

Hi, I tried adding that to both my apache config file and the .htaccess in the root html directory and Mautic continues to display the normal Mautic 404 error page.

Of course, I did restart apache after editing the files.

I made sure the custom404.html file had the right permissions / ownership and even tried clearing Mautic’s cache. Still didn’t work.

Any suggestion of what could be the problem? Thanks

Well, I patched a version of 2.15.3 with the 7614 pull request. You can download it here. Copy your local.php and any custom themes, if you have them, over to the new install. Re-download the GeoLite IP database. Enable the Skip 404 error tracking for anonymous contacts on your install found at the URL /s/config/edit#trackingconfig.

1 Like

Hi, thanks, I’m going to try that. Question: I’m currently on 2.15.2… should I update my installation to 2.15.3 first via the built-in updater before I upload this patched version?

Update your install and then use the patched version.