Streaming live at 10am (PST)

Cookie script for pop up modal

Hi there :slight_smile:

Is there someone here who can help with a script that let me give a user a pop-up the 5th time they visit the website? So the first 4 time they don’t see it, the 5th they see it. If they close it they won’t see it again.

I have this script that works great for first time visitors. Maybe it can be modified?

<!-- Cookie Script START -->
<script src=""></script>

var cookieName = 'modalClosed';
if(typeof Cookies.get(cookieName) !== 'undefined') {
$('.modal-close-button, .modal-success-close-btn').on('click', function(){
Cookies.set(cookieName, 'ok', { expires: 365 });
<!-- Cookie Script END -->

Appreciate all help I can get <3