Appearance
Plain HTML (script tag)
Add the tag
Put one tag in your page's <head>:
html
<script src="https://cdn.jsdelivr.net/npm/simpledatalogs@0.5.0/dist/simpledatalogs.min.js" data-key="sdl_pub_…" defer></script>Or let npx simpledatalogs init add it to index.html for you.
Early access
The CDN URL works once the package is published to npm with the public launch.
The tag is the opt-in: it captures page views, outbound clicks, data-track clicks and errors, with no cookies and no browser storage. Add data-autocapture="false" to send only your own events.
Your own events
html
<button onclick="simpledatalogs.track('demo_requested', { plan: 'team' })">Book a demo</button>simpledatalogs is the global client; simpledatalogs.log('error', 'Checkout failed') sends a log line.
Or mark the element and skip the code:
html
<button data-track="demo_requested" data-track-plan="team">Book a demo</button>In the first minute
- A
page_viewwithpath,title,referrerandutm_*, and the visit on the Sessions tab. - One
page_viewper page load, and per path change on single-page sites. - Uncaught errors and unhandled rejections on the Logs tab.
Attributes
| Attribute | Default | Meaning |
|---|---|---|
data-key | — | Your public key (required) |
data-endpoint | https://edge.simpledatalogs.com | Another ingest host |
data-autocapture | on | "false" for manual calls only |
data-outbound-links | on | "false" stops tracking clicks on links to other sites |
data-storage | off | "true" keeps unsent events and a tab session in browser storage |
Do Not Track and Global Privacy Control are respected: with either on, nothing is captured automatically. There are no cookies and nothing in browser storage. The file is about 9 KB gzipped.