From 03f38dd8b42f8f7a6a0b7e0ba54a22c97df54ef7 Mon Sep 17 00:00:00 2001 From: Renzo Lucioni Date: Fri, 21 Nov 2014 12:53:59 -0500 Subject: [PATCH] Use analytics.identify instead of the old utility function --- common/static/js/src/utility.js | 7 ------- lms/templates/widgets/segment-io.html | 5 ++++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/common/static/js/src/utility.js b/common/static/js/src/utility.js index beecb549cb..630f234bee 100644 --- a/common/static/js/src/utility.js +++ b/common/static/js/src/utility.js @@ -40,10 +40,3 @@ window.rewriteStaticLinks = function(content, from, to) { var regex = new RegExp("(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%_\+.~#?&//=]*))?"+fromRe, 'g'); return content.replace(regex, replacer); }; - -window.identifyUser = function(userID, email, username) { - analytics.identify(userID, { - email: email, - username: username - }); -}; diff --git a/lms/templates/widgets/segment-io.html b/lms/templates/widgets/segment-io.html index 12e799c800..77953ce40d 100644 --- a/lms/templates/widgets/segment-io.html +++ b/lms/templates/widgets/segment-io.html @@ -7,7 +7,10 @@ analytics.page(); % if user.is_authenticated(): - window.identifyUser("${user.id}", "${user.email}", "${user.username}"); + analytics.identify("${user.id}", { + email: "${user.email}", + username: "${user.username}" + }); % endif