Jump to content

Detect first time visitors


Rissinko

Recommended Posts

Hi,

Is there any solution how to detect in tpl file visitor which is on page for first time ? I want to create Welcome animation but show it only for first time visitors. Maybe something like detect if cookies were already created or somethink like that.

 

 

Thanks. 

Link to comment
Share on other sites

You can do this by checking the $_COOKIE array, since it can't be modified until the page refreshes. For example, put the following line in the PHP file:

 

$this->context->smarty->assign('first_time', count($_COOKIE) == 0);

 

And then in your TPL file:

 

{if $first_time}Welcome code goes here{/if}

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
×
×
  • Create New...