Your software
My Mautic version is: 5.1.0
My PHP version is: 8.1.29
My Database type and version is: MySQL 5.7.44
Your problem
I need the ability to track users from our main website into Mautic. The main website is running NextJs so we use this piece of code added to every page for tracking via mautic script:
window.mt("send", "pageview", {
path: pathname,
email,
})
The mt object is then appended to the page via GTM. I can see all the events from website inside mautic (in the page_hits
table) but they are not connected to the correct contact even though the email in query is in Mautic as a contact. It seems Mautic creates a new lead, assigns the device ID and tracks it that way. How can I identify the contact in the tracking event so the page hits are correctly linked?