Skip to content
Docs

Widget Analytics Events Reference

Full list of beyondRegular widget events, payload fields, and code snippets for forwarding to GA4, Meta Pixel, and Shopify web pixel.

Widget Analytics Events Reference
SetupWidget Analytics Events Reference

beyondRegular emits DOM events on the widget container and posts the same payloads to your analytics endpoint if you set one. Listen on the div that carries data-bn-preset, or forward events to GA4, Meta, or Shopify web pixel. Event names are stable: bn:view, bn:play, bn:product_click, bn:add_to_cart, bn:checkout_start.

Event catalogue

Every widget instance dispatches CustomEvents on its own container. The container is the div you dropped in with data-bn-preset. Events bubble, so you can also listen on document if you have several widgets on one page.

The full list: bn:ready fires once the widget mounts. bn:view fires when a video enters the viewport past 50 percent. bn:play, bn:pause, bn:complete track playback. bn:product_click fires when a shopper taps a tagged product. bn:add_to_cart fires on cart add. bn:checkout_start fires when the shopper hits checkout. bn:error fires on load or playback failure with an error code.

Payload shape

Every event.detail carries the same base fields: presetId, videoId, productId (null if the event is not product-scoped), sessionId, and ts (unix ms). Product events also carry variantId, priceMinor, and currency (ISO 4217, INR for Indian shoppers).

Example handler:

<script async src="https://www.itsbeyondregular.com/embed.js"></script> <div data-bn-preset="PRESET_ID"></div> <script> document.addEventListener('bn:add_to_cart', (e) => { const { productId, variantId, priceMinor, currency, videoId } = e.detail; console.log('cart add', productId, priceMinor / 100, currency); }); </script>

priceMinor is always an integer in the smallest unit (paise for INR, cents for USD). Divide by 100 for display. Never trust the client value for billing, the merchant gateway is the source of truth.

Forwarding to GA4 and Meta Pixel

The widget does not ship a GA or Pixel integration by default. You wire it up in one place with the DOM listener. Fire gtag or fbq inside the handler and you get parity with your existing funnel.

<script> document.addEventListener('bn:product_click', (e) => { const d = e.detail; if (window.gtag) gtag('event', 'select_item', { item_id: d.productId, item_variant: d.variantId, value: d.priceMinor / 100, currency: d.currency }); if (window.fbq) fbq('track', 'ViewContent', { content_ids: [d.productId], value: d.priceMinor / 100, currency: d.currency }); }); </script>

On Shopify Pro, the beyondRegular web pixel already reports product_viewed and product_added_to_cart against the same order tokens, so you do not need to double-report those two.

Server webhook (optional)

If you want events server-side, set an Analytics Webhook URL in the dashboard under Preset then Analytics. beyondRegular POSTs a JSON body per event with a X-BR-Signature header (HMAC SHA-256 of the raw body using your webhook secret).

Verify before you trust the payload:

const sig = req.headers['x-br-signature']; const mac = crypto.createHmac('sha256', process.env.BR_WEBHOOK_SECRET) .update(req.rawBody).digest('hex'); if (sig !== mac) return res.status(401).end();

Retries run for 24 hours with exponential backoff on any non-2xx response. Respond fast (under 3 seconds) or the request is treated as failed. Idempotency key is event.id, safe to dedupe on.

Debugging in the browser

Add ?bnDebug=1 to any page URL and the widget logs every dispatched event to the console with the full detail payload. It also prints the resolved preset config and the catalogue fetch timing.

If you see bn:ready but no bn:view, the container is likely below the fold or hidden by CSS (display:none blocks the IntersectionObserver). If bn:product_click never fires, check that products are tagged in the frame from the dashboard, an untagged video still plays but has no clickable regions.

For attribution gaps on Shopify, confirm the theme app embed is enabled and the store is on the Pro plan. The web pixel only writes attribution when both conditions are true.

Common questions

Do I need to install anything besides embed.js to get events?

No. Events dispatch automatically from the widget container the moment embed.js mounts it. You only add code if you want to forward events somewhere: your own analytics, GA4, Meta Pixel, or a server webhook. The one-line install stays the same: <script async src="https://www.itsbeyondregular.com/embed.js"></script> plus your <div data-bn-preset="PRESET_ID"></div>. On Shopify, the theme app embed handles this for you and the Pro plan web pixel reports cart and checkout events without extra wiring.

What is the difference between bn:add_to_cart and the Shopify web pixel event?

bn:add_to_cart is a client-side DOM event that fires the instant the shopper taps the button inside the widget. It is useful for GA4, Meta Pixel, and any custom listener. The Shopify web pixel event product_added_to_cart fires from Shopify itself once the cart mutation succeeds server-side, and it carries the Shopify cart token. Use bn:add_to_cart for funnel widgets and creative testing. Use the Shopify pixel event for attribution and revenue reporting on the Pro plan.

Can I turn off specific events?

Yes, per preset. Open the preset in the dashboard, go to Analytics, and toggle off any event you do not want dispatched. Turning an event off stops both the DOM dispatch and the webhook delivery for that preset. bn:ready and bn:error cannot be disabled because they are used for support diagnostics. If you only want to silence console noise during development, remove ?bnDebug=1 from the URL rather than disabling events, otherwise your production analytics will go dark too.

Put shoppable video on your store.

7-day free trial. No card needed.

Start free trial