Sriram
Sriram

Reputation: 787

Determine user navigation behavior

I want to determine how the user navigated to the current page he is in.

  1. User type the url and press enter.
  2. User press back/forward button
  3. User redirected from some other page.
  4. Any other possible ways of navigation. (like bookmark)

Can i determine this using javascript?

Upvotes: 0

Views: 126

Answers (1)

user2879041
user2879041

Reputation: 1095

Using the window.performance.navigation.type object you can more or less determine how the user got there and other information. More information about the object and navigation timing can be found here.

Upvotes: 3

Related Questions