mirror of
https://github.com/nickzuber/meteorite.git
synced 2024-10-26 11:21:18 +03:00
Attempt to add some more analytics
This commit is contained in:
parent
85d2ad3704
commit
595a74eb20
@ -18,10 +18,9 @@ import {
|
||||
// @TODO: abstract further once confirmed this works.
|
||||
function gtag () {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
return () => {
|
||||
window.dataLayer.push(arguments);
|
||||
};
|
||||
window.dataLayer.push(arguments);
|
||||
}
|
||||
|
||||
function gaTrack (options) {
|
||||
gtag('config', 'UA-154218045-1', options);
|
||||
}
|
||||
|
@ -41,6 +41,28 @@ export const Mode = {
|
||||
OLD: 3
|
||||
};
|
||||
|
||||
// @TODO: abstract further once confirmed this works.
|
||||
function gtag () {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
window.dataLayer.push(arguments);
|
||||
}
|
||||
|
||||
function gaTrackNotificationStaged (value) {
|
||||
gtag('event', 'notification_staged', {
|
||||
event_category: 'notification',
|
||||
event_label: 'Notification read',
|
||||
value
|
||||
});
|
||||
}
|
||||
|
||||
function gaTrackNotificationRead (value) {
|
||||
gtag('event', 'notification_read', {
|
||||
event_category: 'notification',
|
||||
event_label: 'Notification archived',
|
||||
value
|
||||
});
|
||||
}
|
||||
|
||||
// @TODO Move these functions.
|
||||
|
||||
/**
|
||||
@ -244,12 +266,14 @@ class NotificationsPage extends React.Component {
|
||||
}
|
||||
|
||||
enhancedOnStageThread = (thread_id, repository) => {
|
||||
gaTrackNotificationStaged(thread_id);
|
||||
this.props.storageApi.incrStat('stagedCount');
|
||||
this.props.storageApi.incrStat(repository + '-stagedCount', '__REPO__');
|
||||
this.props.notificationsApi.stageThread(thread_id);
|
||||
}
|
||||
|
||||
enhancedOnMarkAsRead = (thread_id, repository) => {
|
||||
gaTrackNotificationRead(thread_id);
|
||||
this.props.storageApi.incrStat('stagedCount');
|
||||
this.props.storageApi.incrStat(repository + '-stagedCount', '__REPO__');
|
||||
this.props.notificationsApi.markAsRead(thread_id);
|
||||
|
Loading…
Reference in New Issue
Block a user