From dc802016ee39d804a2087713898789e4c9ea7f45 Mon Sep 17 00:00:00 2001 From: corinaper Date: Mon, 19 Jun 2023 11:41:43 +0200 Subject: [PATCH] [ONL-7610] Remove legacy ga implementation (#68) * remove legacy ga implementation * deleted value from gtag --- CHANGELOG.md | 4 ++++ package-lock.json | 7 +++++-- package.json | 2 +- src/huha.js | 13 +++---------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c31bf69..bece8a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.4.3] - 2023-06-16 +### Changed +- Removed legacy analytics.js commands for Google Analytics + ## [3.4.2] - 2022-10-04 ### Changed - Removed "value" from GA event diff --git a/package-lock.json b/package-lock.json index 73530bc..9b7a29b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ebury/huha", - "version": "3.4.2", + "version": "3.4.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@ebury/huha", - "version": "3.4.2", + "version": "3.4.3", "license": "MIT", "dependencies": { "@babel/polyfill": "7.7.0", @@ -33,6 +33,9 @@ "jest": "26.6.3", "vinyl-buffer": "1.0.1", "vinyl-source-stream": "2.0.0" + }, + "engines": { + "node": ">=16" } }, "node_modules/@babel/code-frame": { diff --git a/package.json b/package.json index 863d53d..e1bccc6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@ebury/huha", "description": "huha.js (Hyperactive Users Hint Analysis) is a JavaScript framework that measures the usability and user experience in an automated way, including the limitations of the model and the best practices.", - "version": "3.4.2", + "version": "3.4.3", "repository": "github:Ebury/huha", "author": "Ebury Team (http://labs.ebury.rocks/)", "license": "MIT", diff --git a/src/huha.js b/src/huha.js index 2f7bd8b..0528aee 100644 --- a/src/huha.js +++ b/src/huha.js @@ -1,4 +1,4 @@ -/* global ga, Intercom, gtag, analytics, localStorage */ +/* global Intercom, gtag, analytics, localStorage */ // TODO: Remove after addressing the story ONL-5293 /* eslint max-classes-per-file: ["error", 3] */ @@ -160,10 +160,6 @@ class HuhaTask { event_label: 'Effort', value: this.effort, }); - } else if (typeof ga !== 'undefined') { - ga('send', 'timing', this.name, this.status, this.time, 'Time on task'); - ga('send', 'event', this.name, this.status, 'Error', this.errors); - ga('send', 'event', this.name, this.status, 'Effort', this.effort); } } @@ -289,14 +285,11 @@ class HuhaEvent { sendToGoogleAnalytics() { if (typeof gtag !== 'undefined') { gtag('event', this.action, { + // ignoring the "value" as it needs to be an int for the event to fire, + // currently we are sending str event_category: this.category, event_label: this.object, - value: this.value, }); - } else if (typeof ga !== 'undefined') { - // ignoring the "value" as it needs to be an int for the event to fire, - // currently we are sending str - ga('send', 'event', this.category, this.action, this.object); } }