I’d like to link the current visitor’s IP to a specified user ID (via PHP) which Piwik should track across several (sub)domains.
There are several (sub)domains and I want to give a visitor (IP), who is logging in at secure.example.com, a unique UserID to track him on all other domains. The link “IP -> UserID” at login should be made in PHP (Piwik Tracking PHP Client -> setUserId). The “normal” page tracking on all domains (including secure.example.com after login) should be based on JavaScript (Piwik JS tracking snippet).
My problem is:
When I log into secure.example.com and then visit support.example.com (or www.example.com etc.), Piwik does not link these visits to the UserID I set before.
In addition if I overwrite the UserID for the current visitor, it won’t change in Piwik backend.
Are both JS codes on both domains setting the same user id AND setting the same Site ID? then Piwik should track them in the same visit… if you are not seeing this, it could be a bug in Piwik.
secure.example.com sets the User ID via PHP once at login (Site ID 3). The JS snippet is used only for tracking before and after login (also Site ID 3). On support.example.com only JS tracks the page visits (Site ID 2) and does not set any User ID (same on www.example.com but with Site ID 1).
I just want to link a User ID with the current IP at login on secure.example.com and then track this user on all other (sub)domains without setting the User ID again (for 24 hours or so).
I too am curious about how one would do this. Our goal for using piwik is less to get raw analytics data, and more geared towards user behavior tracking. I want to be able to tag a user when they log in through a domain that basically acts as a gateway, setting the userId, and make sure the same user is tracked through other domains that are using the same siteId, even if the userId isn’t set on the other domains (because they aren’t dynamic, and aren’t hooked into our login system).
Edit: I see there is this open ticket on github that might effectively solve this problem, though it looks like a ways off. Is there some other way that we could hand off userId data to the link to the next site?
We are testing Piwik for the same purpose as the topic of this thread. We need to get a complete log of the user’s visit across our websites.
We have reviewed your plugin and we see that it relies on the config_id field. In our case this would not work since two users that have the same browser config (browser version, plugins etc…) would have the same config_id and count only as one. Is there another way to track the user across domains and get the complet log we need?
Thank you for your response.
We checked that plugin and had it installed but it bases on the config_id the decision whether two visits come from the same user or not. In our tests several visitors had the same config_id.
With the use of the third party cookies we can have unique users correctly tracked across websites.
The topic is a bit outdated so I hope you’ll receive this response. That is the exact same problem I’m facing at the moment. I want tot track across domains, but don’t really know how to implement it.
Could you maybe explain to me how you did it? So which codes have you edited and added to the pages and with the 3rd party cookie?
I’m looking for this a long time, hope you can help me.
just saw your email. Sorry for the delay. In case you haven’t figured it out or for anybody else who is interesetd, we had to add the following lines to the config.ini file. By doing this, one user will have the same id_visitor across all sites.