Skip to content

Commit

Permalink
Added Google Analytics for the metrics rendering error
Browse files Browse the repository at this point in the history
Added Google Analytics for the metrics rendering error
#1480
  • Loading branch information
rushirajnenuji committed Dec 1, 2020
1 parent 3462e5e commit 51a5539
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/js/views/portals/PortalMetricsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@ define(["jquery",
"\" portal at this time.</p>"
}

//Send this exception to Google Analytics
if(MetacatUI.appModel.get("googleAnalyticsKey") && (typeof ga !== "undefined")){
var gaMetricsErrorMessage = "Failed to render the Metrics view for the portal: " + (this.model.get("label") || this.model.get("portalId")) + " | v. " + MetacatUI.metacatUIVersion;
ga("send", "exception", {
"exDescription": gaMetricsErrorMessage,
"exFatal": false
});
}

//Show a warning message about the metrics error
MetacatUI.appView.showAlert(
errorDisplayMessage,
Expand Down

0 comments on commit 51a5539

Please sign in to comment.