-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Proposal - create a separate class for analytics that would be accessible via the GraphAcademyPage class.
Constraints
- We only want to start tracking after the user is logged in
Platforms to integrate
- Mixpanel
- Intercom
Functions -
init()- initates the tracking libraries and sets identify eg:mixpanel.indentity(user_id);track(eventName, meta, platform)- platform will specify which platform to send data to. For eg, we might have a event that we want to track in Mixpanel but not in Intercom.
Sandbox Implementation:
.....
shouldTrackPlatform(options, platformName) {
return !!(
!options
|| (!options.all && options[platformName])
|| (options.all && options[platformName] !== false)
);
}
track(eventName, meta, platform = null) {
const shouldTrackMixPanel = this.shouldTrackPlatform(platform, 'mixpanel');
const shouldTrackIntercom = this.shouldTrackPlatform(platform, 'intercom');
if(shouldTrackMixpanel) ..............
if(shouldTrackIntercom) ..............
}
.....Possible platform values
{all: false, mixpanel: true}- tracks only in mixpanel{all: true, mixpanel: false}- track everything but mixpanel
Inspired by segment.com implementation - https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#selecting-destinations
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels