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:
[ul]
[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
[/li][/ul]
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?
Until I know a better way I will save the current user id in a custom user variable but I really think it should be possible to force a new visit without any hacks.