Newsletter Modal cookie inclusion

I have a modal that launches as soon as you visit my clients site. I need it to launch only if you’re a first time visitor or if you haven’t visited the site within the last 60 days. I’m currently using the below code before the body tag to launch the model. At the moment it launches anytime you go to the homepage. How do I incorporate a cookie function that checks to see if a visitor has been to the site within a set timeframe to control whether the modal launches or not? Thanks in advance!


<script type="text/javascript">

$(document).ready(function() {
$('.close-button-class-here').click(function() {


Hi There,

Not a coder, but I’ll probably be attempting to use this info here for a client build with a splash screen. Maybe you’ll find it helpful.

If you read down through, they figure it out in a one of those js fiddles. The code looks rather minimal to pull off a “one day” cookie session for showing/hiding a thing. It mentions you’ll need to include a cookie library, thankfully - they’ve also chosen/used one for their demo that is hosted on cdjsn :wink:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.