Skip to main content
Requires @lerix-dev/lerix-angular 1.3.0 or later. @angular/router is a peer dependency. For what each module does and what you see in the dashboard, read Feedback, NPS surveys and Analytics.

Setup

Add provideLerixRouterTracking() next to the provideLerix() from Installation. It records a $screen_view on every Router NavigationEnd, and turns off the SDK’s History API tracking so nothing is counted twice.
app.config.ts
The optional name maps a path (without query or hash) to a screen name, so /orders/42 and /orders/43 count as one screen. Return null to skip a path. provideLerix() also takes locale, analytics (enabled, autoSessions, autoScreens), feedback (theme, primaryColor, strings, zIndex) and captureConsoleErrors. They work as in React.

In-app feedback

toolbar.component.ts
LerixFeedbackService has: The dialog renders inside a Shadow DOM, is a lazy chunk loaded on first use, and ships English and Arabic (right to left). The lerixConfidential directive adds data-lerix-mask, which blacks the element out of screenshots.

NPS survey

Pass { force: true } while testing to skip the rules. See When the survey is shown.

Analytics

LerixAnalyticsService has track, screen, flush, setEnabled (the persisted opt-out), isEnabled, getSessionId and addBreadcrumb. $first_open, $session_start / $session_end, $app_update and $screen_view are recorded automatically. track never throws.
Call setUser after sign-in. Analytics then counts the person across devices, and you can reply to their feedback by push.
The last 50 breadcrumbs (navigation is added automatically) are attached to feedback. Categories: navigation, log, http, ui, custom.