mirror of
https://github.com/audacity/audacity.github.io.git
synced 2026-05-30 20:47:36 -05:00
feat: add Clarity injection utility
This commit is contained in:
21
src/assets/js/clarityTracking.js
Normal file
21
src/assets/js/clarityTracking.js
Normal file
@@ -0,0 +1,21 @@
|
||||
// src/assets/js/clarityTracking.js
|
||||
|
||||
let clarityInjected = false;
|
||||
|
||||
export function injectClarity() {
|
||||
if (clarityInjected) return;
|
||||
clarityInjected = true;
|
||||
|
||||
(function (c, l, a, r, i, t, y) {
|
||||
c[a] =
|
||||
c[a] ||
|
||||
function () {
|
||||
(c[a].q = c[a].q || []).push(arguments);
|
||||
};
|
||||
t = l.createElement(r);
|
||||
t.async = 1;
|
||||
t.src = "https://www.clarity.ms/tag/" + i;
|
||||
y = l.getElementsByTagName(r)[0];
|
||||
y.parentNode.insertBefore(t, y);
|
||||
})(window, document, "clarity", "script", "wccf621mrt");
|
||||
}
|
||||
Reference in New Issue
Block a user