@mac
To display a pop-up only once per user on Shopify, you can use a combination of cookies and Shopify's built-in tools. Here is a step-by-step guide to achieve this:
1 2 3 4 5 6 7 8 9 |
<script> document.addEventListener('DOMContentLoaded', function() { if (!document.cookie.includes('popupDisplayed')) { // Display the pop-up message using your preferred method (e.g. JavaScript modal) // Set a cookie to track that the pop-up has been displayed document.cookie = 'popupDisplayed=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/'; } }); </script> |
By following these steps, you can display a pop-up message to users on your Shopify store only once per user. This can help prevent annoying users with repetitive pop-ups and improve the user experience on your site.