From 4cdb9deef18b5558ce52b9dde151bce2d1129079 Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Tue, 3 Sep 2024 13:25:57 -0700 Subject: [PATCH] [i1020] - correct ga4 typo that prevents download tracking In Google Analytics we were missing the tracking for download events. This is because there was a typo in content_id. Issue: - https://github.com/scientist-softserv/palni-palci/issues/1020 --- app/assets/javascripts/hyrax/analytics_events.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/hyrax/analytics_events.js b/app/assets/javascripts/hyrax/analytics_events.js index c4f1b22364..a19d20c71c 100644 --- a/app/assets/javascripts/hyrax/analytics_events.js +++ b/app/assets/javascripts/hyrax/analytics_events.js @@ -89,11 +89,11 @@ $(document).on('click', '#file_download', function(e) { window.trackingTags.analytics().push([trackingTags.trackEvent(), 'work-in-collection', 'work-in-collection-download', collection]); }); } else { - gtag('event', 'file-set-download', { 'content-type': 'file-set', 'content-id': $(this).data('label')}) - gtag('event', 'file-set-in-work-download', { 'content-type': 'file-set-in-work', 'content-id': $(this).data('work-id')}) + gtag('event', 'file-set-download', { 'content-type': 'file-set', 'content_id': $(this).data('label')}) + gtag('event', 'file-set-in-work-download', { 'content-type': 'file-set-in-work', 'content_id': $(this).data('work-id')}) $(this).data('collection-ids').forEach(function (collection) { - gtag('event', 'file-set-in-collection-download', { 'content-type': 'file-set-in-collection', 'content-id': collection }) - gtag('event', 'work-in-collection-download', { 'content-type': 'work-in-collection', 'content-id': collection }) + gtag('event', 'file-set-in-collection-download', { 'content-type': 'file-set-in-collection', 'content_id': collection }) + gtag('event', 'work-in-collection-download', { 'content-type': 'work-in-collection', 'content_id': collection }) }); } });