Skip to main content

Class: BaseAnalytics

Types.BaseAnalytics

Server-side rendering friendly analytics class. Can be used to identify users and track virtual page views.

Hierarchy

Constructors

constructor

new BaseAnalytics(__namedParameters)

Parameters

NameType
__namedParametersAnalyticsOptions

Methods

identify

identify(user): void

Identifies a user for the purpose of user activity tracking. Where possible user identification is done automatically.

Parameters

NameTypeDescription
userBaseUserThe 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

NameTypeDescription
optionsObject-
options.url?stringThe URL of the page to track as the subject of the virtual page view.
options.userAgent?string-

Returns

void