How to create a cookie banner in Shopify

LokeshPrajapat
Shopify Partner
1 0 1

Hi,

 

I am trying to add a cookie banner in my store from this article "https://shopify.dev/docs/themes/trust-security/cookie-banner" and I followed all the step which are mentioned in the article and added the "cookie-banner.liquid" snippet to the "theme.liquid" file and the banner is showing me successfully but when I am clicking on the "Accept" or "Decline" buttons the banner is hiding that is fine but when I am reloading the site the cookie banner is showing me again that is the issues I am facing so anyone can help me to resolve this.

 

I want when the user or customer clicks on the buttons "Accept" or "Decline" the cookie banner should be hidden and If the customer reloads the site again the banner should not be visible until the cookie expires or removed by the user or customer.

Reply 1 (1)

oliversinz
Shopify Partner
96 7 17

Hi @LokeshPrajapat 

Hope you're having a great day!

Have you checked your browser's console to see if there are any errors in your JavaScript?

Maybe you are missing something in the code. Would you kindly show me your code?

- Was my reply helpful then Click Like and Mark it as an Accepted Solution

- Feel free to contact me regarding any help on: Twitter | LinkedIn | My website



- Want to modify or custom changes on store Hire me.
Shopify Partner | Full Stack Software Developer