Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/3.x/tracking-javascript-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,14 @@ If you want to create a new visit when your users logout, then you can also forc

// User has just logged out, we reset the User ID
_paq.push(['resetUserId']);
// we also delete cookies to make sure that a new Visitor ID is generated
_paq.push(['deleteCookies']);
// we also force a new visit to be created for the pageviews after logout
_paq.push(['appendToTrackingUrl', 'new_visit=1']);

_paq.push(['trackPageView']);

// we make sure to not again create a new visit afterwards (important for Single Page Applications)
// we finally make sure to not again create a new visit afterwards (important for Single Page Applications)
_paq.push(['appendToTrackingUrl', '']);

```
Expand Down