Web push on Shopify: what works, honestly
Shopify doesn’t let stores host a file at yourstore.com/sw.js, and browsers require exactly that. Here are the options that do work, and what each one costs you in effort.
- Web push needs a service worker served from your store’s own domain, at the root.
- Shopify (like Wix and Squarespace) doesn’t allow uploading a file there.
- Workaround 1: if your domain runs through Cloudflare, a small Worker route can serve /sw.js.
- Workaround 2: collect subscribers on a site you control and link to the store.
Why it’s tricky
A service worker only controls pages inside its own path on its own origin. To receive notifications for every page of yourstore.com, the worker must load from yourstore.com/sw.js. Shopify doesn’t let merchants publish a file at that path. App proxies exist, but they live under /apps/…, which limits the worker to those pages only.
Options that work
| Option | Effort | Coverage |
|---|---|---|
Cloudflare Worker route on yourstore.com/sw.js serving Pusharoo’s file, plus the snippet in theme.liquid | Medium (domain must be proxied by Cloudflare) | Whole store |
| Shopify App Proxy | High (custom app) | Only /apps/… pages |
| Collect on a site you own (blog, landing page) and link to the store | Low | That site’s visitors |
Step-by-step notes are in the docs. Before proxying a Shopify domain through Cloudflare, check Shopify’s current guidance on third-party proxies for custom domains.
Adding the snippet in Shopify
Online Store → Themes → Edit code → theme.liquid, paste the Pusharoo script tag right before </head>. Without a working /sw.js, the snippet stays quiet rather than showing a prompt that can’t work.
Plays once it’s running
Back-in-stock and flash-sale pushes are the classic winners. See ecommerce push notifications.
How the Cloudflare Worker route works
- Your store’s custom domain must be proxied by Cloudflare (orange cloud).
- Create a Worker that fetches
https://pusharoo.com/sw.jsand returns it withContent-Type: application/javascriptandCache-Control: no-store. - Add a route for
yourstore.com/sw.jspointing at that Worker. - Open
https://yourstore.com/sw.jsin a browser to confirm it serves JavaScript. - Paste the snippet in
theme.liquid, then subscribe and send yourself a test.
The browser now sees the worker as part of your store’s origin, so the whole store is covered.
Before you go live
- Only one service worker on the store (remove any other push app first).
- Rocket Loader and script optimizers off for
/sw.js. - Test on Android Chrome and, if you use a manifest, on iPhone from the Home Screen.
Questions
Does Pusharoo have a Shopify app?
Not today. Shopify’s root-file restriction means a Cloudflare Worker route or collecting on your own domain are the practical options.
Why do some Shopify push apps work?
Apps can use Shopify-specific mechanisms or host the subscription page on their own domain. Check which domain your subscribers are actually subscribing to.
Keep reading
Push notifications for online stores
Flash sales, back-in-stock, price drops and retargeting — without paying for ads.
Web push for WordPress and WooCommerce
Upload sw.js, paste one line, exclude it from caching. Works with WooCommerce too.
How web push works, step by step
Push API, service workers, VAPID keys and encryption — the full technical path of a notification.
Choosing a push notification service for your website
A no-nonsense checklist: caps, badges, gated features, ownership, iPhone, setup effort.
More in Platforms: WooCommerce push notifications: setup and playbook · Magento 2 push notifications · Web push on Wix, Squarespace and Webflow · All guides
Free for life. No limits.
Unlimited subscribers, campaigns and automations. No badges. About five minutes to install.