Skip to main content
Solved

How do I track first page view?


Forum|alt.badge.img

We currently track page views on our website (ie every time a user lands on a page we fire an amplitude event with relevant page data like url, title, etc). 

 

We want to also be able to track the first page visited, meaning we want to know what page a completely new user lands on first.

 

Is there any suggested way of doing that via Amplitude?

 

Thanks! 

Best answer by SheenaGreen

Hi @veshei,

 

One idea that comes to mind is setting a user property that contains the page info along with your page view event. You could use setOnce so the user property is not overwritten upon subsequent page view event fires. Here’s more info on setting user properties via the JS SDK.

 

 

View original
Did this topic help you find an answer to your question?

2 replies

SheenaGreen
Super Helper
Forum|alt.badge.img+8
  • Super Helper
  • 60 replies
  • Answer
  • April 19, 2022

Hi @veshei,

 

One idea that comes to mind is setting a user property that contains the page info along with your page view event. You could use setOnce so the user property is not overwritten upon subsequent page view event fires. Here’s more info on setting user properties via the JS SDK.

 

 


Forum|alt.badge.img
  • Author
  • New Member
  • 1 reply
  • April 19, 2022

Thanks @SheenaGreen for the tip! That seems to work.

 

Only weird thing is that the $identify function that calls setOnce still shows up in the amplitude extension on every route change (which is what page view does). But in amplitude itself the first value logged by setOnce is the one that it is set to. Took me a bit to realize the extension wasn’t showing the setOnce properly! 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings