This namespace handles a number of analytics related functions. The vast majority of these features are already wired by default, but and are only required to be called manually if you are doing something special. By default, both GA and qlitics are tracked (including when pages are loaded via AJAX).
The GA tracker looks for the default tracker, then looks for the tracker called gtm1
. If you would like to disable GA tracking, set window.qtNoAutomaticGATracking
to true.
import * from "@quintype/framework/client/analytics";
Methods
# static registerPageView(page, newPath) → {void}
Register a page view in both qlitics and google analytics. This method takes the page object, which is usually returned from "/route-data.json".
Parameters:
Name | Type | Description |
---|---|---|
page |
Object
|
ex: {"page-type": "story-page", "story": {...}} |
newPath |
string
|
ex: "/path/to/story" |
void
# static registerStoryShare(storyContentId, socialMediaType, storyUrl) → {void}
This event will register a social share of a story in qlitics
Parameters:
Name | Type | Description |
---|---|---|
storyContentId |
uuid
|
The id of the story being shared |
socialMediaType |
string
|
The social network the item is being shared on |
storyUrl |
string
|
The canonical URL of the story |
void
# static registerStoryView(storyContentId) → {void}
Register a story view event. This should already be wired up for story pages, but this event can be fired on an infinite scroll event. Ideally, please use registerPageView
Parameters:
Name | Type | Description |
---|---|---|
storyContentId |
uuid
|
void
# static setMemberId(memberId) → {void}
Set the current member id on qlitics
Parameters:
Name | Type | Description |
---|---|---|
memberId |
number
|
The member id of the logged in member |
void