First-Party Analytics (Insights)
Self-hosted, cookie-light analytics built into the SDK.
Updated
On this page
dash.insights
Insights is DashForDevs' own first-party analytics — a lightweight collector in the SDK that feeds visitor, pageview, event and conversion data straight to your dashboard (no GA4 required). It also powers accurate order attribution because the visitor id is carried into server-side checkout.
Initialize
dash.insights.init({ autoPageviews: true, autoClicks: true })
Track
dash.insights.pageview("/products/blue-dream")
dash.insights.track("add_to_cart", { sku, price })
dash.insights.identify(customerId, { email })
dash.insights.conversion(orderTotal, { orderId })
dash.insights.notifyRouteChange(pathname) // SPA route changes
Attribution helpers
dash.insights.getVisitorId()
dash.insights.getSessionId()
dash.insights.getAttribution() // first-touch / last-touch
dash.insights.attributionForOrder() // attach to a checkout payload
Events are batched and flushed to POST /api/storefront/analytics/collect via
navigator.sendBeacon (falling back to fetch). Bots are classified out
server-side so dashboard metrics reflect real users. See
Dashboard → Marketing → Native Analytics and the conversion funnel.