-
-
Notifications
You must be signed in to change notification settings - Fork 20
Google Analytics plugin
R.Brown edited this page Jan 4, 2021
·
3 revisions
Track tour events with Google Analytics.
- Send Google Analytics event before tour step change
- Send Google Analytics event after tour step change
- Track time spent on each tour step via Google Analytics events
- Track step button click via Google Analytics events
Please refer to the plugins' installation and configuration Wiki page.
Note: Commercial GuideChimp plugins require a valid customer account with the assigned plan and additional configuration, which will be used to validate the availability of particular GuideChimp functions or plugins for the given customer account.
Method: gaOn(event, action, parameters = {})
-
event
: GuideChimp event -
action
: Google Analytics event action -
parameters
(optional): Google Analytics parameters object
// global events
GuideChimp.gaOn('onBeforeChange', 'Global Event', { event_category: 'Event Category' });
var guideChimp = GuideChimp(tour, options);
// specific tour events
guideChimp.gaOn('onBeforeChange', 'Tour Event', (to, from) => {
return {
event_category: 'Category ' + to.title,
event_label: 'Step ' + to.step,
};
});
Method: gaTiming(startEvent, endEvent, parameters = {})
-
startEvent
: GuideChimp start event -
endEvent
: GuideChimp end event -
parameters
(optional): Google Analytics parameters object
// global timing
GuideChimp.gaTiming('onStart', 'onStop', { event_category: 'Tour' });
var guideChimp = GuideChimp(tour, options);
// specific tour timing
guideChimp.gaTiming('onBeforeChange', 'onAfterChange', (toBefore, fromBefore, toAfter, fromAfter) => {
return {
event_category: 'Category ' + toBefore.title,
event_label: 'Step ' + toBefore.step,
};
});
Method: gaEvent(action, parameters = {})
-
action
: Google Analytics event action -
parameters
(optional): Google Analytics parameters object
var guideChimp = GuideChimp([{
title: 'Step 1',
description: 'Step 1 description',
buttons: [
{
title: 'OK',
onClick() {
guideChimp.gaEvent('OK button click', { event_category: 'Button' })
}
}
]
}]);