This script records the date+time of your visitor's last visit and displays it upon their return. If this is their first visit to your site, a greeting message is shown instead. You can customize the messages to display in each case.
1.Login to your dashboard--> layout- ->Page Elements
2.Click on 'Add a Gadget' on the sidebar.
3.Select 'HTML/Javascript' and add the code given below and click save.
var days = 730; // days until cookie expires = 2 years. lastvisit.getCookie=function(Name){ lastvisit.setCookie=function(name, value, days){ var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days)); lastvisit.showmessage = function() { else { lastvisit.setCookie("visitc", wh, days); } lastvisit.showmessage(); </script> |
Now you are done.Refresh your site to see result.