Docs / Anleitungen
Dieser Artikel wird auf Englisch angezeigt.
Install your site
You need three things: the SDK snippet on your pages, a root-covering service worker on the visitor origin, and your public VAPID key. HTTPS is required. en-sdk.js is served by EngageNudge, so /en-sw.js is the only file you host.
Script
- Dashboard → Integrations → Script.
- Copy the snippet. It loads
en-sdk.jsfromhttps://engagenudge.com/sdk/v1/with your site key, VAPID public key, API URL, tenant id, and site id. - Download
en-sw.jsfrom the dashboard and host it at the site root, on the same origin as the page. Browsers refuse a service worker from anywhere else. - Open a public page and run Install Doctor.
Full reference: JavaScript SDK and Service worker.
WordPress
- Install the EngageNudge plugin (sideload the zip; WordPress.org listing is not submitted yet).
- Dashboard → Integrations → Script → generate a pairing code.
- WordPress → Settings → EngageNudge → API URL, site id, pairing code → Pair site.
- If you already have a root service worker, merge with
importScripts('https://engagenudge.com/sdk/v1/en-sw.js');.
The plugin injects the SDK and can serve the worker. Publishing a post creates a draft campaign. It never live-sends on publish.
Guide: WordPress.
Google Tag Manager
- Host
/en-sw.json the origin. The tag loads the SDK from EngageNudge. - Import the EngageNudge SDK template in GTM.
- Fill site key and VAPID public key. Trigger on All Pages, or on consent update if you use a CMP.
- Preview, then confirm Install Doctor.
GTM can inject the SDK and relay consent. It cannot install a same-origin service worker. A GTM-only setup without /en-sw.js will not go fully green.
Guide: Google Tag Manager.
After install
- Opt-in for the permission prompt
- CSP if you have a Content-Security-Policy
- Troubleshooting if Install Doctor stays red