Docs / Entwickler

Dieser Artikel wird auf Englisch angezeigt.

Shopify

What exists today

There is no EngageNudge app in the Shopify App Store. The dedicated app is built but not released, so treat anything you read about it elsewhere as a plan rather than a product.

That does not block you. Shopify is a normal website, and the standard snippet install works there the same way it works anywhere else. Nothing about push notifications is Shopify-specific.

Install on Shopify today

Two pieces, and the order matters.

1. Host the service worker at the root of your store.

Push notifications need a service worker served from your own domain, at exactly /en-sw.js. A browser will not accept one from anywhere else, which is why no tag manager and no theme app extension can do this step for you.

In Shopify: Settings → Files → Upload files, then upload the en-sw.js stub you download from the dashboard Integrations tab. Shopify serves uploads from its CDN rather than your root, so this alone is not enough. Add a redirect: Settings → Navigation → URL redirects → Create URL redirect, from /en-sw.js to the uploaded file's URL.

Then check it. Open https://yourstore.com/en-sw.js in a browser. You should see JavaScript, not HTML and not a 404.

2. Add the snippet to your theme.

Online Store → Themes → Edit code → layout/theme.liquid, and paste the snippet from the dashboard just before </head>. It looks like this:

html
<script
  src="https://engagenudge.com/sdk/v1/en-sdk.js"
  data-site-key="YOUR_SITE_KEY"
  data-vapid-public-key="YOUR_VAPID_PUBLIC_KEY"
  defer
></script>

Install Doctor in the dashboard will tell you if either half is missing.

If your store is behind a bot filter

Cloudflare, Shopify's own protections and most WAFs will challenge requests that do not look like a person browsing. A challenge on /en-sw.js makes the service worker fail to register, and it fails quietly: visitors simply never become subscribers, with nothing in the interface to say why.

If you run a WAF in front of your store, allow /en-sw.js through without a challenge before you test.

What the app will add

When the Shopify app ships it will remove the two manual steps above, and add cart and stock events so you can nudge on abandoned carts and back-in-stock. It will not make push work better. The delivery path is the same one the snippet uses.

We would rather say this plainly than let you wait for something that has no date.