Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen authored and Amy Chen committed Dec 4, 2024
1 parent 8ca30ce commit 4e7ab82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/helpers/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,16 +724,16 @@ export function getUserIdFromAccessToken() {
export function addMamotoTracking() {
// already generated script, return
if (document.querySelector("#matomoScript")) return;
window._paq = [];
window._paq.push(["trackPageView"]);
window._paq.push(["enableLinkTracking"]);
const userId = getUserIdFromAccessToken();
// no user Id return
if (!userId) return;
const siteId = getMamotoTrackingSiteId();
// no site Id return
if (!siteId) return;

// init global piwik tracking object
window._paq = [];
window._paq.push(["trackPageView"]);
window._paq.push(["enableLinkTracking"]);
window._paq.push(["setSiteId", siteId]);
window._paq.push(["setUserId", userId]);

Expand Down

0 comments on commit 4e7ab82

Please sign in to comment.