0

I would like to keep track of the number of visits for each anonymous user. I want to be able to show special messages, for example when they visit the site the 10th time.

Incrementing a cookie variable will just be fine in this case. How do I find out when a new session has started?

1

This would be difficult I believe, because every anonymous visitor is essentially treated as the same, as one account.

|improve this answer|||||
0

You are most likely best to make use of session_api module and some custom moduling.

|improve this answer|||||
  • Session may be cleared when user leaves the site. – Mołot May 16 '13 at 11:32
0

Needed functions are readily described in manual: http://api.drupal.org/api/drupal/modules!user!user.module/function/user_cookie_save/7

Don't forget to respect Do Not Track or you risk a lawsuit in some jurisdictions.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.