Project portfolio Browse selected work

Shopify Plus Upgrade Monthly Fee Reduction + Up to $4800 Development Fee Credit - Exclusive WesWoo Offer

Search
Interaction, SEO and release acceptance
Choose module

Newsletter triggers and feedback

Dismiss before submitting and reopen. Distinguish dismissal, successful submission and confirmation rather than treating one impression as a signup.

Is waiting ten seconds enough to diagnose a missing mobile popup?

Use a fresh session and record viewport width, elapsed time and any seen flag. Change one condition at a time to distinguish eligibility, delay and frequency.

We advanced the browser clock by ten seconds at 390 pixels and varied the desktop breakpoint, mobile eligibility and same-session seen flag.

Compare results, scope and replay code

The desktop gate still suppressed the popup after ten seconds. With mobile eligible it was hidden at 9,999 ms and visible after ten seconds. A seen flag suppressed it again.

The post supplies Split 1.1.7 markup and delay settings. The original trigger script and browser state are missing. The fixture does not establish which storage the theme used.

Tested in Chrome 157.0.8103.79. In a clean directory with Node.js 22 or later run, in order, npm install playwright → npx playwright install chromium → node weswoo-popup-gates.cjs.

Download replay script (.cjs)

Original question · MDN · Window.matchMedia()

Test dismissal, submission, confirmation and a fresh session independently. Suppression may be local frequency control. Consult the customer consent record before sending marketing.

The idle page opened the popup. Focus in an input suppressed it at the same timeout, a condition worth retesting after changing delays.

Reproduce the test and inspect the readings

Use the same short timer and scroll threshold. Compare an idle page with focus held in an external input. Read whether the popup opened.

In the order above
open then closed

WESWOO ran this entry’s published script in standalone Chrome with the fixture markup and records described here.

2026-11-24 · Chrome 157.0.8103.79 · assets/ww-newsletter-trigger.js

Download test conditions and raw readings (JSON)

Inspect the source and verification point

assets/ww-newsletter-trigger.js · line 5

  if (!dialog.showModal || root.querySelector('[data-newsletter-feedback="true"]')) return () => {};
  const key=root.dataset.newsletterKey;let elapsed=false,shown=false;
  try {shown=sessionStorage.getItem(key)==='dismissed';}catch {}

How the module works

Make the invitation worth understanding

Someone comparing models needs more than an instruction to leave an email address. Describe the messages the store will actually send and link its real privacy policy. The example submits contact[email] through a customer form for marketing signup, separate from support enquiries.

Make submission work in ordinary page flow first and inspect the server response. Acceptance, any further confirmation and actual email delivery need separate evidence. Describe only the verified state, keeping signup and error correction usable without a popup.

Open the dialog when it can fit the task

The example waits for both eight seconds and 25% scrolling. These adjustable defaults are not universal timing recommendations. Automatic opening yields to focused controls, another dialog or dismissal in the current session. Store dismissal state rather than the email address, and retain manual opening.

Render newsletter-popup, load its modules and call bindNewsletter(root), adapting dialog dimensions and focus styling to the theme. Keep server feedback in page flow instead of moving it into an automatic dialog. Follow the same signup journey through closing, Escape and unenhanced browsing.

Example source code

View 3 source filesLIQUID · JS
snippets/ww-newsletter-popup.liquid
<section data-ww-newsletter data-newsletter-key="newsletter-{{ section.id }}">
  <button type="button" data-ww-newsletter-open hidden>Subscribe by email</button>
  <div data-ww-newsletter-inline>
    <h2>Receive product guides and store updates</h2>
    <p>Enter your email to subscribe to marketing updates. See the store privacy policy for details.</p>
    {% assign signup_id = 'Signup-' | append: section.id %}
    {% form 'customer', id: signup_id %}
      <div data-newsletter-feedback="{% if form.errors or form.posted_successfully? %}true{% else %}false{% endif %}">
        {% if form.errors %}<div role="alert">{{ form.errors | default_errors }}</div>{% endif %}
        {% if form.posted_successfully? %}<p role="status">Subscription submitted.</p>{% endif %}
      </div>
      <label for="SignupEmail-{{ section.id }}">Email</label>
      <input id="SignupEmail-{{ section.id }}" type="email" name="contact[email]" autocomplete="email" required>
      <input type="hidden" name="contact[tags]" value="newsletter">
      <button type="submit">Subscribe</button>
    {% endform %}
    {% if shop.privacy_policy != blank %}<a href="{{ shop.privacy_policy.url | escape }}">Privacy policy</a>{% endif %}
  </div>
  <dialog id="Newsletter-{{ section.id }}" data-ww-newsletter-dialog aria-label="Email subscription">
    <button type="button" data-ww-dialog-close>Close subscription</button>
  </dialog>
</section>

Integration and checks

Integration steps

3 steps
  1. Verify the native form response

    Render newsletter-popup and first validate native success and error responses.

  2. Connect the dialog triggers

    Load both JavaScript modules and call bindNewsletter(root); session dismissal affects automatic opening only.

  3. Check mobile layout and focus

    Supply current-theme dialog/backdrop and focus styles and test phone purchase access.

Data and dependencies

  • The Shopify customer form submits contact[email], with actual subscription and privacy information.
  • Default thresholds are eight seconds and 25% scroll; session state stores dismissal, not an email.

Interaction and states

  • A server error or success response prevents moving the form into an automatic modal.
  • Escape or Close dismisses and restores focus; automatic opening does not repeat in that session.

Before launch

State feedback
StateTriggerOutcome
Threshold unmetInsufficient time or scrollDo not open automatically
Both thresholds and no interruptionOpen onceSupport dismissal and focus return
Server feedback or dismissedReload or scrollKeep feedback visible or suppress automatic opening

The native customer form represents marketing subscription. Match the disclosure to actual email use and validate the store confirmation behavior.

Sources and further reading

Scope and licensing

Educational implementations for Shopify themes and Headless projects. Confirm real inputs, interaction states and existing components in a development theme before store acceptance. Missing task-specific WESWOO articles remain unlinked.

Shopify/dawnLicenseShopify-integration theme license; architecture reference without copying the implementation. · 3e9ee2281dc4Shopify/hydrogenLicenseMIT; retain copyright and license when using substantial code. · 9e358a2462ba

References checked · 2026-11-24