add Segment click tracking for the documentation feedback buttons (#2085)

This commit is contained in:
trean
2026-01-20 13:43:20 +01:00
committed by GitHub
parent d5081edc57
commit 24fc98e9b8
3 changed files with 4 additions and 5 deletions
@@ -110,7 +110,6 @@ document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('.menu-mobile__item').forEach((item) => {
item.addEventListener('click', () => {
console.log(item.dataset.path);
toggleMenu(item.dataset.path);
});
});
@@ -49,10 +49,10 @@ const handleClickInteraction = (event) => {
}
};
// Gather all <a> elements that have been tagged
// Gather all <a> and <button> elements that have been tagged
// for tracking via 'data-metric-loc' attribute
function tagAllAnchors() {
const allMetricsAnchors= document.querySelectorAll('a[data-metric-loc]');
const allMetricsAnchors= document.querySelectorAll('a[data-metric-loc], button[data-metric-loc]');
if (allMetricsAnchors) {
allMetricsAnchors.forEach(anchor => {