From: Bill Erickson Date: Mon, 2 Apr 2018 20:18:31 +0000 (-0400) Subject: JBAS-2002 Self-reg googalyitcs on submit/cancel events X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=837a40ea78b8f438b17ebd50073c606a1ebcb420;p=working%2FEvergreen.git JBAS-2002 Self-reg googalyitcs on submit/cancel events Send events to Goog indicating a submit or cancel button event. Minor cleanup of old commented code. Signed-off-by: Bill Erickson --- diff --git a/KCLS/openils/var/templates_kcls/opac/register.tt2 b/KCLS/openils/var/templates_kcls/opac/register.tt2 index 9d3accd312..f9d5f60c67 100644 --- a/KCLS/openils/var/templates_kcls/opac/register.tt2 +++ b/KCLS/openils/var/templates_kcls/opac/register.tt2 @@ -80,11 +80,19 @@ END; # input_field() [% l('[_1]', ctx.page_title) %] - - [% INCLUDE 'opac/parts/goog_analytics.tt2' %] - + + + [%# INCLUDE 'opac/parts/goog_analytics.tt2' %] + + @@ -641,7 +649,7 @@ END; # input_field() value="[% l('Submit Registration') %]"/>
-
diff --git a/Open-ILS/web/js/ui/default/opac/register.js b/Open-ILS/web/js/ui/default/opac/register.js index 99dbb15eee..69edf9010c 100644 --- a/Open-ILS/web/js/ui/default/opac/register.js +++ b/Open-ILS/web/js/ui/default/opac/register.js @@ -242,9 +242,26 @@ function onsub() { alert(msg); return false; } + + if (typeof ga === 'function') { + console.debug('sending GA Submit event'); + ga('send', 'event', 'Full Application', 'submit', 'Forms'); + } + return true; } +function handleCancel(url) { + + if (typeof ga === 'function') { + console.debug('sending GA Cancel event'); + ga('send', 'event', 'Full Application', 'cancel', 'Forms'); + } + + location.href = url; + return false; // avoid form submission +} + function activity_checker_thread() { var start = last_activity.getTime(); var end = new Date().getTime();