Docs Getting started Quick start

Quick Start

Get elNudge installed, firing events, and delivering your first nudge in five minutes.

This guide takes you from zero to a working install — with a live cart event and your first nudge — in five minutes.

Step 1: Get your site key

  1. Log in to app.elnudge.com.
  2. Click Add Site and enter your domain.
  3. Open the Install tab on your new site.
  4. Copy your site key — it looks like sk_live_XXXXXXXX.

Step 2: Install the script tag

Add the following snippet to <head> on every page. Replace YOUR_SITE_KEY with the key you just copied.

<script
  src="https://cdn.elnudge.com/v1/sdk.js"
  data-site-key="sk_live_YOUR_SITE_KEY"
  data-debug="true"
  async
></script>

data-debug="true" prints every event to the browser console so you can confirm things are working before going live.

Step 3: Fire a CART_ADD event

Wherever your "Add to cart" handler runs, call:

window.__eln('track', 'CART_ADD', {
  product_id: 'prod_abc123',
  product_name: 'Wireless Headphones',
  variant_id: 'var_blue_lg',
  price: 2999,      // in smallest currency unit (paise, cents, etc.)
  currency: 'INR',
  quantity: 1,
})

If window.__eln is not yet defined when your page first loads, use the pre-load queue pattern so the call is replayed once the SDK is ready:

window.__eln = window.__eln || function () {
  (window.__eln.q = window.__eln.q || []).push(arguments)
}

window.__eln('track', 'CART_ADD', {
  product_id: 'prod_abc123',
  product_name: 'Wireless Headphones',
  price: 2999,
  currency: 'INR',
  quantity: 1,
})

Step 4: Open Live Preview and verify

  1. In the dashboard, click Live Preview on your site.
  2. Open your site in a separate tab.
  3. Add an item to your cart.
  4. Back in Live Preview, you should see the CART_ADD event appear in the event stream within a second or two.

If nothing appears, check the browser console for [elNudge] log lines — debug mode is on so errors will surface there.

Step 5: Watch your first nudge fire

elNudge monitors the session in real time. Once enough intent signals accumulate — for example, a product view followed by a cart add and a scroll to 75 % — the AI will decide to send a nudge.

During testing you can trigger a nudge faster by:

  1. Scrolling the product page to the bottom.
  2. Moving your cursor toward the top of the browser window (exit intent).

The nudge widget will appear. In the Live Preview panel you can see exactly which event triggered it and what the AI sent.


Next steps