Class: BaseAnalytics
Types.BaseAnalytics
Server-side rendering friendly analytics class. Can be used to identify users and track virtual page views.
Hierarchy
BaseAnalytics
Constructors
constructor
• new BaseAnalytics(__namedParameters
)
Parameters
Name | Type |
---|---|
__namedParameters | AnalyticsOptions |
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 BaseAnalytics 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. |
options.userAgent? | string | - |
Returns
void