From 9b2b77a3c5c2aa34a027a5c0ef4b67cb3a13fe79 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 10 Feb 2016 13:16:44 +0100 Subject: [PATCH] add some custom GA events, closes #17 --- _src/_assets/javascripts/bigchain/analytics.js | 14 ++++++++++++-- _src/_includes/menu-footer.html | 4 ++-- _src/_includes/menu-main.html | 2 +- _src/index.html | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/_src/_assets/javascripts/bigchain/analytics.js b/_src/_assets/javascripts/bigchain/analytics.js index 9ce32d1..5f3fe35 100644 --- a/_src/_assets/javascripts/bigchain/analytics.js +++ b/_src/_assets/javascripts/bigchain/analytics.js @@ -1,7 +1,7 @@ // // Google Analytics // -var GoogleAnalytics = (function(w,d) { +var GoogleAnalytics = (function(w,d,$) { var app, _private; @@ -14,6 +14,16 @@ var GoogleAnalytics = (function(w,d) { // jQuery('.js-tracking-').on('click', function() { // ga('send', 'event', [eventCategory], [eventAction], [eventLabel]); // }); + + // Menu clicks + $('.js-tracking-menu').on('click', function() { + ga('send', 'event', 'menu_click', 'link_click', 'text_link', true); + }); + + // Terminal interaction + $('.js-tracking-terminal').on('click', function() { + ga('send', 'event', 'terminal', 'terminal_click', 'selection', true); + }); }, @@ -100,4 +110,4 @@ var GoogleAnalytics = (function(w,d) { return app; -})(window, document); +})(window, document, jQuery); diff --git a/_src/_includes/menu-footer.html b/_src/_includes/menu-footer.html index e605b9d..ad316df 100644 --- a/_src/_includes/menu-footer.html +++ b/_src/_includes/menu-footer.html @@ -9,7 +9,7 @@ {% assign active = 'active' %} {% endif %} - {{ link.title }} + {{ link.title }} {% endfor %} @@ -22,7 +22,7 @@ {% assign active = 'active' %} {% endif %} - {{ link.title }} + {{ link.title }} {% endfor %} diff --git a/_src/_includes/menu-main.html b/_src/_includes/menu-main.html index ed56a60..92457ec 100644 --- a/_src/_includes/menu-main.html +++ b/_src/_includes/menu-main.html @@ -20,7 +20,7 @@ {% assign active = 'active' %} {% endif %} - {{ link.title }} + {{ link.title }} {% endfor %} diff --git a/_src/index.html b/_src/index.html index 2744c3d..ae34825 100644 --- a/_src/index.html +++ b/_src/index.html @@ -73,7 +73,7 @@ js: page-front.min.js

Read documentation | GitHub

-
+
# install bigchaindb pip install bigchaindb