Theme
💎 Built for Sidekick
✍️ Sidekick drafts it — you apply it
shopify
sidekick
theme
popup
email-capture
Exit-Intent Popup with Email Capture
Exit-intent popup that captures email via the Shopify customer API, with cookie-based frequency control and a coupon reveal — full Liquid/CSS/JS build.
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 code for an exit-intent popup that detects when the customer moves their mouse toward the browser address bar or outside the viewport on desktop, and triggers after [MOBILE_DELAY_SECONDS] seconds of inactivity on mobile. The popup should display a centered modal overlay with a heading [POPUP_HEADING], subtext [POPUP_SUBTEXT], an email input field with placeholder [EMAIL_PLACEHOLDER], and a submit button labeled [BUTTON_TEXT] with background color [BUTTON_BG_COLOR]. When submitted, the email should be posted to the Shopify customer API endpoint to create a marketing-consented customer record. After successful submission, display a thank-you message [THANK_YOU_MESSAGE] and auto-close after [AUTO_CLOSE_SECONDS] seconds. Include an optional coupon code display [COUPON_CODE] shown after submission. Set a cookie named [COOKIE_NAME] with expiry [COOKIE_EXPIRY_DAYS] days so the popup does not appear again for returning visitors. The modal should have background color [MODAL_BG_COLOR], text color [MODAL_TEXT_COLOR], border radius [BORDER_RADIUS] pixels, max-width [MODAL_MAX_WIDTH] pixels, and an X close button in the top right corner. The overlay background should be [OVERLAY_COLOR] with opacity [OVERLAY_OPACITY]. Include settings to exclude the popup on specific pages by entering a comma-separated list of page handles [EXCLUDED_PAGES]. Provide the complete Liquid, CSS, and JavaScript as a section I can paste into my theme myself. Where to add it: In the Shopify admin, go to Online Store > Themes > Edit code, create a new file under Sections (e.g. sections/exit-intent-popup.liquid), paste the generated code in, and save. Since a popup needs to render on every page, add the new section to your theme’s global sections group — in the theme editor open any page, scroll to the bottom section list (or edit layout/theme.liquid directly to include it), and add the popup section there so it loads site-wide.
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