Skip to content

Commit

Permalink
Update eventTag.ts
Browse files Browse the repository at this point in the history
Resolves #429
  • Loading branch information
StevenWeathers committed Jul 13, 2023
1 parent c1131ba commit 34819ad
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions frontend/src/eventTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ function createFunctionWithTimeout(callback, opt_timeout?) {
return fn
}

export default function (action, category, label, cb = function () {}) {
export default function (action, category, label, cb = function () {
}) {
// provide fallback should gtag not be available
const t =
gtag ||
function (evt, action, opts) {
cb()
}
let t = function (evt, action, opts) {
cb()
}
if (typeof gtag !== "undefined") {
t = gtag
}

t('event', action, {
event_category: category,
Expand Down

0 comments on commit 34819ad

Please sign in to comment.