From 65d95036c09095d3f051e21c64bc678a9a340ee9 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Wed, 18 Apr 2018 10:15:54 +0200 Subject: [PATCH] added piwik tracking for RandomPlayer --- .../custom/edlptheme/assets/dist/scripts/main.min.js | 9 +++++++++ sites/all/themes/custom/edlptheme/assets/scripts/main.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js b/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js index 6be8ec3cb..2ce567593 100644 --- a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js +++ b/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js @@ -1044,12 +1044,21 @@ this.$btn.addClass('is-active'); this.shuffle(); this.next(); + // piwik + if(typeof _paq !== 'undefined'){ + // trackEvent(category, action, [name], [value]) + _paq.push(['trackEvent', 'RandomPlayer', 'start']); + } }, stop(){ this.active = _audioPlayer.shuffle_is_active = false; this.$btn.removeClass('is-active'); // stop audio player // _audioPlayer.stop(); + if(typeof _paq !== 'undefined'){ + // trackEvent(category, action, [name], [value]) + _paq.push(['trackEvent', 'RandomPlayer', 'stop']); + } }, next(){ if(this.active && this.shuffledPlaylist.length > 0) diff --git a/sites/all/themes/custom/edlptheme/assets/scripts/main.js b/sites/all/themes/custom/edlptheme/assets/scripts/main.js index 6be8ec3cb..2ce567593 100644 --- a/sites/all/themes/custom/edlptheme/assets/scripts/main.js +++ b/sites/all/themes/custom/edlptheme/assets/scripts/main.js @@ -1044,12 +1044,21 @@ this.$btn.addClass('is-active'); this.shuffle(); this.next(); + // piwik + if(typeof _paq !== 'undefined'){ + // trackEvent(category, action, [name], [value]) + _paq.push(['trackEvent', 'RandomPlayer', 'start']); + } }, stop(){ this.active = _audioPlayer.shuffle_is_active = false; this.$btn.removeClass('is-active'); // stop audio player // _audioPlayer.stop(); + if(typeof _paq !== 'undefined'){ + // trackEvent(category, action, [name], [value]) + _paq.push(['trackEvent', 'RandomPlayer', 'stop']); + } }, next(){ if(this.active && this.shuffledPlaylist.length > 0)