Install via Shopify App Store
One-click install from the Shopify App Store — no theme editing required for basic setup.
Installing through the Shopify App Store is the fastest path for Shopify merchants. The app handles script injection automatically, so you do not need to edit theme.liquid for a basic install.
Step 1: Install from the App Store
- Find elNudge in the Shopify App Store and click Add app.
- You will be redirected to the OAuth consent screen. Review the permissions and click Install app.
- After the OAuth flow completes you are taken to the elNudge dashboard, already linked to your Shopify store.
That's it for the base install. The app registers a ScriptTag via the Shopify API, which injects the elNudge SDK on every storefront page — including the cart, collections, and product pages — without any changes to your theme files.
What is injected automatically
The ScriptTag injection adds the equivalent of:
<script
src="https://cdn.elnudge.com/v1/sdk.js"
data-site-key="sk_live_YOUR_SITE_KEY"
async
></script>
From this point, elNudge automatically tracks:
- Page views and route changes
- Scroll depth (25 / 50 / 75 / 100 %)
- Hover time on product elements
- Exit intent
- Tab switches and idle time
Why you should still add manual cart events
The automatic ScriptTag gives you passive behavioral signals, but it cannot read cart mutations from inside Shopify's JavaScript. To get full conversion accuracy you need to fire CART_ADD, CART_REMOVE, and PURCHASE events manually. Without them:
- The AI cannot react to add-to-cart moments in real time.
- Purchase events are missed entirely, so conversion attribution is incomplete.
- Revenue reporting in the dashboard will be empty.
Manual wiring takes about ten minutes and is strongly recommended.
Wire CART_ADD and CART_REMOVE in your theme
Find the JavaScript that calls the Shopify Cart API — usually in assets/cart.js, assets/theme.js, or a snippet in snippets/cart-drawer.liquid. After the successful response from the cart API, fire the corresponding event:
// After a successful POST to /cart/add.js
fetch('/cart/add.js', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ id: variantId, quantity: 1 }),
})
.then(res => res.json())
.then(item => {
window.__eln('track', 'CART_ADD', {
product_id: String(item.product_id),
product_name: item.product_title,
variant_id: String(item.variant_id),
price: item.price, // Shopify returns price in cents
currency: Shopify.currency.active,
quantity: item.quantity,
})
})
// After a successful POST to /cart/change.js that reduces quantity to 0
window.__eln('track', 'CART_REMOVE', {
product_id: String(productId),
variant_id: String(variantId),
})
Wire the PURCHASE event in order-status.liquid
The order status page (the "Thank you" page) is the most reliable place to fire the PURCHASE event. It runs once per completed order and is not blocked by ad blockers that target checkout pages.
Open Online Store → Themes → Edit code and find layout/order-status.liquid (or sections/checkout-order-summary.liquid depending on your theme). Paste this before </body>:
{% if first_time_accessed %}
<script>
window.__eln = window.__eln || function () {
(window.__eln.q = window.__eln.q || []).push(arguments)
}
window.__eln('track', 'PURCHASE', {
order_id: '{{ order.id }}',
order_name: '{{ order.name }}',
total: {{ order.total_price }}, // in cents
currency: '{{ order.currency }}',
line_items: [
{% for line_item in order.line_items %}
{
product_id: '{{ line_item.product_id }}',
product_name: {{ line_item.title | json }},
variant_id: '{{ line_item.variant_id }}',
price: {{ line_item.price }},
quantity: {{ line_item.quantity }},
}{% unless forloop.last %},{% endunless %}
{% endfor %}
],
})
</script>
{% endif %}
The first_time_accessed guard ensures the event fires only once per order, even if the customer refreshes the confirmation page.
Verify the install
- Open your storefront in a browser.
- Open the browser console and run:
It should returntypeof window.__eln === 'function'true. - In the elNudge dashboard, open Live Preview on your site and browse a product page. You should see
PAGE_VIEWevents appear within a second.
See Verify script firing for a full troubleshooting checklist.