I using the custom variables to save the user id if someone logs into my site per visit.
My problem is that because it’s tracked per visit I don’t know when a user logged in and out with different accounts.
I thought about it for a while and thought of a few ways to fix this:
[li] set variable per page instead of visit
[/li][li] create a goal for logging in
[/li][li] somehow start a new session when logging in with id different from custom variable
I think the last is the best way as it’s save to assume that most times the same visitor won’t log in with more than one account.
So my question is: Is there a way to tell Piwik to start a new visit, preferably with the JS API.
Or is there a better option?