I went and did a test to try and add a new “quick user” manually through the system. I used the same email as an existing one and get the following:
When I went and saved the contact it actually made a duplicate - is this the correct behaviour?
Mautic automatically merges contact by unique identifier field(s) when the data are coming from outside (CSV import, API, form submissions) but it will allow you to create a duplicate via UI. It should display a warning that a contact with the same email address exists as you type it in to the new contact form. But it won’t stop you nor merge. I don’t recall why it was designed this way but here we go.
There is a handy command to deduplicate all contacts based on the unique identifier fields. It will merge the field values as well as the history of both contacts.
This command is not very fast. If you have millions of contacts it can take days and even weeks. I created a pull request making it way faster and it’s waiting for one more tester to approve it and merge it:
Thank you for the explanation @escopecz . I will go and pull this patch and test it myself now.
What do you think of the fact that the tracking script has the possibility of making duplicate contacts as shown above in this thread ?
In the scenario, the tracking script is creating users however our thinking is maybe our client has not implemented it correctly and it is being called multiple times and hence forming a race condition of sorts ?
I did start running the dedup a while ago and saw that it was very very slow and yes we have millions of contacts
The tracking script should also deduplicate contacts automatically.
But indeed. I saw it too that some users implement the tracking script multiple times on their website and so multiple same requests are going to Mautic at the same time and a race conditions causes the contacts to be created twice. It’s not hard to spot that when you load the website tracked by Mautic that there are multiple POST requests to the tracking endpoint.