Skip to content

Commit

Permalink
Fix JS error in GA4 event tracking (Fixes #14177)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgibson committed Feb 5, 2024
1 parent 91a371a commit 1020b01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions media/js/base/datalayer-productdownload.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,11 @@ TrackProductDownload.handleLink = (event) => {
TrackProductDownload.sendEventFromURL = (downloadURL) => {
// get event object
const eventObject = TrackProductDownload.getEventFromUrl(downloadURL);
// send for tracking
TrackProductDownload.sendEvent(eventObject);

if (eventObject) {
// only send event for tracking if eventObject is valid (issue 14177)
TrackProductDownload.sendEvent(eventObject);
}
};

/**
Expand Down

0 comments on commit 1020b01

Please sign in to comment.