Search code examples
matomo

Different visitor id assigned across different states Piwik


Currently, I'm overriding the visitor id column in piwik by my self generated visitor id.

Now there are requests going to two different domains. Even though I am assigning my own visitor id, these two different domains are assigned different visitor ids.

Questions:-

1.Does piwik append anything else to visitor id as a means of differentiating?

2.If no, why are there two different visitor ids present?

3.Is there any other means to keep the visitor id consistency across domains?


Solution

  • When there is no visitor id present, mamoto generates a visitor id itself. It's probably because along your requests, maybe somewhere your visitor id propagation gets lost and that's where mamoto itself assigns a visitor id to your input data.

    Your 3rd point

    Consistency across domains is hard to keep in my opinion.

    1. Currently, what I can think of is, passing the visitor id as a query parameter to your redirect url ( whenever you send a request to a different domain ), and you can then check, if the visitor id exists, attach it to further requests that you have to send.
    2. Or instead of generating your visitor ids at the front end, you can generate them at the backend, and send them across to the frontend as some encoded token. You fetch that token in the front end and propagate that across various cross / same domain requests.