Skip to content

Commit

Permalink
[ONL-7610] Remove legacy ga implementation (#68)
Browse files Browse the repository at this point in the history
* remove legacy ga implementation

* deleted value from gtag
  • Loading branch information
corinaper authored Jun 19, 2023
1 parent 0e45942 commit dc80201
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 3 additions & 10 deletions src/huha.js
Original file line number Diff line number Diff line change
@@ -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] */
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit dc80201

Please sign in to comment.