Install the elNudge SDK
Add the elNudge script tag to your site and start tracking visitor intent in under two minutes.
elNudge runs as a single, async <script> tag. Paste it once — events start flowing immediately with no further configuration required.
Get your site key
Every site you add in the dashboard gets a unique site key. Site keys look like:
sk_live_XXXXXXXX— production trafficsk_test_XXXXXXXX— staging and development (no nudges fire to real visitors)
To find your key, open app.elnudge.com, navigate to your site, and copy the snippet from the Install tab.
Add the script tag
Paste the following snippet inside <head> on every page of your site. Replace YOUR_SITE_KEY with the key from your dashboard.
<script
src="https://cdn.elnudge.com/v1/sdk.js"
data-site-key="sk_live_YOUR_SITE_KEY"
async
></script>
Place it as early as possible in <head>. The async attribute means it will never block page rendering.
What happens automatically after install
Once the script loads, elNudge:
- Starts a session — assigns a session ID (
ses_01HXXXXX) to the visitor and begins intent tracking. - Fires a PAGE_VIEW event — recorded immediately on load.
- Listens for scroll depth — fires at 25 %, 50 %, 75 %, and 100 % scroll depth.
- Watches for exit intent — fires when the visitor's cursor moves toward the top of the viewport.
- Tracks hover, clicks, tab switches, and idle time — no configuration needed.
No cookies are set before user consent if you are using a CMP — see the consent guide for details.
Verify the install
Open your browser console and run:
typeof window.__eln === 'function' // should return true
For a richer verification flow, see Verify script firing.
Configuration attributes
| Attribute | Required | Default | Description |
|---|---|---|---|
data-site-key | Yes | — | Your site key (sk_live_… or sk_test_…) |
data-debug | No | false | Logs every event to the browser console |
data-quiet-zones | No | — | Comma-separated URL patterns where nudges are suppressed |
Quiet zones
Suppress nudges on pages where they would be intrusive — legal pages, checkout, blog, etc:
<script
src="https://cdn.elnudge.com/v1/sdk.js"
data-site-key="sk_live_YOUR_SITE_KEY"
data-quiet-zones="/checkout/*,/blog/*,/privacy,/terms"
async
></script>
You can also manage quiet zones from the dashboard under Engagement Rules → Quiet Zones, which overrides the attribute if both are set.
Single-page applications
The SDK automatically patches history.pushState and history.replaceState, and listens to popstate and hashchange, so route changes are tracked without any extra code. See SPA routing for framework-specific notes.