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.
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.
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.
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.