cdn.wendung.app instead of installing @wendung/sdk. The script initializes itself from the tag’s data attributes and exposes Wendung as a global, so you can track steps from inline handlers or a plain <script>.
The file is the same code as the npm package at that version, built as a self-contained script of about 4 KB compressed.
Setup
1
Add the script tag
Put the tag in Each attribute maps to an
<head> on every page you want tracked. Use defer so the SDK runs before your own deferred scripts and before DOMContentLoaded.init() option:flushInterval and maxBatchSize have no attribute. To set them, omit data-api-key and call Wendung.init() from your own script with the full options object.2
Register the site
With pageview tracking enabled, the SDK records page loads according to the visitor’s consent state. Open Sites in the dashboard and add your hostname so the pageviews show up as visitors, pages, and sources. The web analytics guide covers path rules and the site dashboard.
Pageviews count against your plan’s monthly pageview allowance, separate from events. The free plan has none. See Plans and limits.
3
Track steps and identify users
Wendung is available on window once the script has run. Inline handlers work because they fire after DOMContentLoaded:Wendung must run after it. Give them defer too (deferred scripts run in document order), or wait for DOMContentLoaded:Versions and caching
The CDN serves three paths for the current release:
Use
latest to receive every SDK release automatically. Use v0 to stay on the 0.x series, or pin an exact version to control when you update. Both latest and the major channel can change behavior when a new release is published.
To use the latest release, change the script’s src:
Wendung.setConsent('granted') switches to full analytics; calling Wendung.setConsent('denied') stops collection. Use a bare data-track-pageviews attribute if you want to wait for consent before collecting anything. See the consent guide to save and restore the visitor’s choice.
Content Security Policy
If your site sets a CSP, allow the script host and the ingest host:What differs from the npm package
- You use the
Wendungglobal instead ofimport { Wendung } from '@wendung/sdk'. The methods are identical. - Initialization happens in the tag. Calling
Wendung.init()again afterwards is safe and replaces the configuration, the same as in the package. - There are no TypeScript types on the global. If you type-check inline scripts, declare
Wendungyourself or move to the package.