Add UJ button events to GA (#7340)

This commit is contained in:
Andrew Chen 2018-02-12 07:26:50 -08:00 committed by k8s-ci-robot
parent ac2f3cdc51
commit 7c69de29b1
1 changed files with 12 additions and 0 deletions

View File

@ -198,6 +198,10 @@ $( document ).ready(function() {
urlParamHash.set("path", type);
urlParamHash.set("persona", null);
urlParamHash.set("level", null);
// record Google Analytics event
ga('send', 'event', 'user-journeys', 'click', 'path', type);
}
// (2) HTML behavior
@ -215,6 +219,10 @@ $( document ).ready(function() {
if (!fromPageload) {
var persona = targetElt.getAttribute('data-button');
urlParamHash.set('persona', persona);
// record Google Analytics event
ga('send', 'event', 'user-journeys', 'click', 'persona', persona);
}
// Use default level if not specified, in order to display the proper
// path-persona-level content
@ -240,6 +248,10 @@ $( document ).ready(function() {
var level = targetElt.getAttribute('data-name');
if (!fromPageload) {
urlParamHash.set('level', level);
// record Google Analytics event
ga('send', 'event', 'user-journeys', 'click', 'level', level);
}
// (2) HTML behavior