Jump to content

Detecting first page view in session


heldercervantes
 Share

Recommended Posts

Hey.

What would be a clever way of detecting if the page being rendered is the first viewed in a session?

Think landing page. In fact, think blog article. I want to put a CTA there that would appear only if the user just landed directly in that page. But if the user came from, i.e., the homepage, I want it to behave differently.

Any ideas?

 

Thanks,
H

Link to comment
Share on other sites

A user going directly to a page is either from a bookmark or typing (pasted) url. So you could check both the referrer and bookmarks on the desired target page(s). Otherwise you'd have to test and set a result (as @DaveP shows) on all non-target pages, then test for that result on all target pages.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...