Theme
💎 Built for Sidekick
✍️ Sidekick drafts it — you apply it
shopify
sidekick
theme
popup
compliance
Cookie Consent Banner
Add a cookie consent banner with Accept All and Manage Preferences options, storing category choices in a cookie.
Sidekick writes it — you put it live
Sidekick produces the content or code for this, but doesn't apply it to your store itself. You'll paste or publish the result yourself — the prompt tells Sidekick to explain exactly where it goes.
📋 Prompt
Generate the Liquid, CSS, and JavaScript for a cookie consent banner section that I can paste into my theme as a custom section, appearing at the [BANNER_POSITION] (top or bottom) of the viewport when a new visitor lands on the site and no consent cookie exists. The banner should display a message [CONSENT_MESSAGE] with a link to the privacy policy page at [PRIVACY_PAGE_URL]. Include two buttons: Accept All with background color [ACCEPT_BG_COLOR] and text color [ACCEPT_TEXT_COLOR], and Manage Preferences with background color [MANAGE_BG_COLOR] and text color [MANAGE_TEXT_COLOR]. When Manage Preferences is clicked, expand or open a panel showing toggle switches for the following cookie categories: Necessary (always on, disabled toggle), Analytics with default [ANALYTICS_DEFAULT] (on or off), Marketing with default [MARKETING_DEFAULT] (on or off), and Functional with default [FUNCTIONAL_DEFAULT] (on or off). A Save Preferences button should store the selections. All consent choices should be saved in a cookie named [COOKIE_NAME] with an expiry of [COOKIE_EXPIRY_DAYS] days. The banner should not appear again until the cookie expires. Include settings for banner background color [BANNER_BG_COLOR], text color [BANNER_TEXT_COLOR], font size [FONT_SIZE], max-width [BANNER_MAX_WIDTH], and z-index [Z_INDEX]. Do not use any third-party scripts. Finally, tell me exactly which file to add this to and how to enable it via the Shopify theme editor — and note that I should have legal counsel confirm this meets GDPR/CCPA requirements before publishing.
How to Use
- Copy the prompt above
- Open Shopify Sidekick in your Shopify admin
- Paste the prompt and replace the bracketed placeholders with your details
- Review Sidekick's response and apply the suggestions