We have two Shopify stores, a .com and a .ca. We want to be able to redirect visitors to their country based shop with a popup that asks whether or not they want to switch to the other website. We were able to implement the code, on our .ca (artifactskin.ca) website, found in this Shopify article:
Everything works great, when a US visitor arrives on the site, they are asked whether or not they want to switch to the .com or they can just close the popup and proceed on the .ca. However, the popup keeps popping up as you click through the website. How can I make it so that when the popup is closed, it stays closed. Perhaps it pops up only on the homepage? or it doesn't popup again for one full day?
You'd need to build in a method to set a cookie that marks if the popup has been closed or not. You'd then check for that cookie on second page load and determine whether it should show again.
You might gleam some info on cookie usage from the Age Gate doc (does require some tech knowlege):
If you want a quick and easy trick, you can also install a Shopify app to do the same. We have an app that do exactly what you need, letting the customer to choose whether they want to jump to the specific site. Check this out: https://apps.shopify.com/geo-ip-redirect-manager
We have an app that could help you out. You can customize a bar/popup with the country choices within the app itself and when a customer makes a choice it will be remembered as well. The bar/popup will not show up again before a preset time period. Moreover, the time period is completely changeable as per your requirements from within the app.
Check out our app: Cozy Country Redirect