Cross domain tracking not working when redirect through form submit

Visitor goes to my first site, then they fill out a form, submits and the php form activates and sends me their info in the form, and they get redirected to the 2nd website. (2 different domains).
But when they redirect through the form, they show as 2 different visitors. Does anyone know how to fix this?

1 Like

Did you do something specific to “identify” a visitor (eg using the UserID, etc.)
Are the 2 websites tracked in one single “measurable” in Matomo?

How would I identify the user with a matomo user ID? If I would need to add the userid of matomo into the php form, how would i do this?

The problem is definitely when they go through the php redirect when the php form opens.

I tested this with 2 different websites (the site they are being redirected to). One website tracks properly and the other does not.
And when they click directly on a URL link on the html website, the tracking works. It does not through php redirect. Any solution anyone knows for this so matomo’s tracking isn’t “broken” by php server redirect?

Hi @Matt_B
Sorry for my silence, I missed your reply…

When I wrote UserID, it would be a user that ou manage on your side (not specifically a Matomo user ID…)

How do you track? JavaScript API? MTM? PHP API?..

Sorry, it is not clear… Can you share some tracking screenshots?