Class: Analytics
Types.Analytics
The interface for SlashID user analytics.
We've built user analytics right into SlashID. We automatically track user activity surrounding sign-up & log-in so we can give you metrics like monthly active users (MAU), returning users, and new users.
Further, we record how people are choosing to authenticate with SlashID and expose this data to you so you can understand user preferences regarding authentication methods, and crucially: any friction caused by requiring that a particular authentication method or combination of authentication methods (MFA) be used.
Constructors
constructor
• new Analytics(options
)
Parameters
Name | Type |
---|---|
options | AnalyticsOptions |
Properties
eventsAPI
• eventsAPI: EventsApi
sdk
• sdk: SlashID
user
• Optional
user: BaseUser
Methods
identify
▸ identify(user
): void
Identifies a user for the purpose of user activity tracking. Where possible user identification is done automatically.
Parameters
Name | Type | Description |
---|---|---|
user | BaseUser | The user being identified. |
Returns
void
logout
▸ logout(): void
Logs the user out from the point-of-view of the Analytics class only, this method does not have a side-effect which affects the logged in state of the user.
After removing a stored token this method should be called to record the log out event.
Returns
void
trackVirtualPageView
▸ trackVirtualPageView(options
): void
Tracks a virtual page view
A virtual page view allows you to track a page view, even when a page is not physically loaded in the browser. For example, when navigating using a client-side router in a single page application, or navigating within a sub-section of a page (like a tabbed pane, or navigation drawer) without changing the page itself.
The exact meaning of a virtual page view will vary by implementation, it depends on your routing paradigm and what you're trying to track. You will need to implement this event in a way which makes sense for your product.
Parameters
Name | Type | Description |
---|---|---|
options | Object | - |
options.url? | string | The URL of the page to track as the subject of the virtual page view. |
Returns
void