diff --git a/control/content/js/classes/analytics.js b/control/content/js/classes/analytics.js index 2a90ce9..1fc7895 100644 --- a/control/content/js/classes/analytics.js +++ b/control/content/js/classes/analytics.js @@ -5,6 +5,8 @@ class Analytics { TOPIC_CRETAED: 'TOPIC_CRETAED', TOPIC_REPORTED: 'TOPIC_REPORTED', TOPIC_DELETED: 'TOPIC_DELETED', + TOPIC_VIEWED:"TOPIC_VIEWED", + TOPIC_SHEARED:"TOPIC_SHEARED", } } @@ -12,6 +14,8 @@ class Analytics { this.registerEvent('Topic Created', this.events.TOPIC_CRETAED, 'Occurs when a user create a new topic', false); this.registerEvent('Topic Reported', this.events.TOPIC_REPORTED, 'Occurs when a user report about a topic', false); this.registerEvent('Topic Deleted', this.events.TOPIC_DELETED, 'Occurs when a user delete a topic', false); + this.registerEvent('Topic Viewed', this.events.TOPIC_VIEWED, 'Occurs when a user view a topic', false); + this.registerEvent('Topic Shared', this.events.TOPIC_SHEARED, 'Occurs when a user share a topic', false); } static registerEvent(title, key, description, silentNotification) { diff --git a/widget/app.js b/widget/app.js index 24adf47..2b8f6d7 100644 --- a/widget/app.js +++ b/widget/app.js @@ -387,6 +387,7 @@ function createListLink(topic) { if (event.target.tagName === 'BUTTON') { return; } + Helper.trackAction(Helper.EVENTS.TOPIC_VIEWED); navigateTo(topic) }; @@ -970,6 +971,7 @@ function shareWithOthers(data) { console.log(err) else console.log(result) + Helper.trackAction(Helper.EVENTS.TOPIC_SHEARED); }); } }); diff --git a/widget/js/classes/helper.js b/widget/js/classes/helper.js index 62b7c4d..2d49bef 100644 --- a/widget/js/classes/helper.js +++ b/widget/js/classes/helper.js @@ -27,6 +27,8 @@ class Helper { TOPIC_CRETAED: 'TOPIC_CRETAED', TOPIC_REPORTED: 'TOPIC_REPORTED', TOPIC_DELETED: 'TOPIC_DELETED', + TOPIC_VIEWED: 'TOPIC_VIEWED', + TOPIC_SHEARED:"TOPIC_SHEARED", } }