From 7c69de29b1673c02b3210c60c0aec2b69ebfa130 Mon Sep 17 00:00:00 2001 From: Andrew Chen Date: Mon, 12 Feb 2018 07:26:50 -0800 Subject: [PATCH] Add UJ button events to GA (#7340) --- js/user-journeys/home.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/user-journeys/home.js b/js/user-journeys/home.js index 23f6f54e57..9c3c7d1a72 100644 --- a/js/user-journeys/home.js +++ b/js/user-journeys/home.js @@ -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