6

I am wanting to display a message when a visitor lands on the site for the first time.

I don't necessarily want to use browser cookies, but would if thats the only solution.

Ideally, would I be better off storing an IP of a visitor in the db?

Something to this effect:

{if first_visit}Welcome Message{/if}
  • 2
    Storing the IP address of every visitor for this purpose will not scale well. I'd recommend against -- cookies are the way to go. – Derek Hogue Nov 30 '12 at 17:27
7

There is Show Once. It does use cookies, but other than that it is probably just what you are looking for.

From the add-on page:

Show Once is the module for ExpressionEngine 2 that allows showing certain content to a user only once (during their first visit). The content that you want to show needs to be wrapped in {exp:show_once:check} tag pair.

{exp:show_once:check code="twitter"}
  Do not forget to follow us on Twitter!
{/exp:show_once:check}
3

Another solution would be to use First-timer. It allows you to redirect a user to a certain page when they login for the first time.

0

To add my two cents: I had exactly the same issue as the OP, but am working on EE 3, where Show Once and First-timer are not ready.

I got around this by using:

{exp:member:custom_profile_data}
  {if last_visit == "0"}Message{/if}
{/exp:member:custom_profile_data}

It works so far! Hope this is of help to someone.

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.