Skip to content
Platforms · 5 min read

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.

Updated By the Pusharoo team
In short
  • 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

OptionEffortCoverage
Cloudflare Worker route on yourstore.com/sw.js serving Pusharoo’s file, plus the snippet in theme.liquidMedium (domain must be proxied by Cloudflare)Whole store
Shopify App ProxyHigh (custom app)Only /apps/… pages
Collect on a site you own (blog, landing page) and link to the storeLowThat 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

  1. Your store’s custom domain must be proxied by Cloudflare (orange cloud).
  2. Create a Worker that fetches https://pusharoo.com/sw.js and returns it with Content-Type: application/javascript and Cache-Control: no-store.
  3. Add a route for yourstore.com/sw.js pointing at that Worker.
  4. Open https://yourstore.com/sw.js in a browser to confirm it serves JavaScript.
  5. 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.

What the Worker actually does

The downloadable Worker answers only /sw.js — with your site key built in and no-store caching — and passes every other request straight through to Shopify. It doesn’t touch checkout, cookies or pages. If you remove the route, push stops working for new subscribers; existing subscriptions keep their worker until browsers check for updates. Test after any DNS change, because Shopify’s domain verification and certificates expect specific records (check Shopify’s current guidance before proxying a store domain).

Shopify events for automations

Once the snippet runs in theme.liquid, you can send events from your theme: Pusharoo.track('added_to_cart') after the cart AJAX call succeeds, and Pusharoo.track('purchase') through Shopify’s order status page additional scripts (where your plan and checkout version allow custom scripts). With those, a cart-reminder automation with “stop if purchase” works without an app (how).

App vs. Worker approach

Shopify push appPusharoo + Worker
SetupInstall from the App StoreCloudflare Worker + snippet
Needs Cloudflare proxyNoYes
PricingOften by notifications or subscribersFree, unlimited
Store data (products, orders)Read by the appOnly what you send as events/tags

See Brevo PushOwl alternative for a dated price comparison.

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.

Can I use a Shopify theme app embed instead?

App embeds are for apps from the Shopify App Store. Pusharoo doesn’t offer one; the snippet goes in theme.liquid, and the worker needs a proxied root path as explained above.

Do Shopify push apps need my customer data?

Many request order and customer access to power automations. Check the scopes an app requests before installing.

More in Platforms: WooCommerce push notifications: setup and playbook · Magento 2 push notifications · Web push on Wix, Squarespace and Webflow · Web push notifications on BigCommerce · Web push notifications for PrestaShop · Web push notifications for Joomla · Web push notifications for Drupal · Web push notifications for Ghost blogs · All guides

Free for life. No limits.

Unlimited subscribers, campaigns and automations. No badges. About five minutes to install.