From e7e54fc1994d4c0bc3acc4c9b8aa6ffdfbd2e03e Mon Sep 17 00:00:00 2001 From: Kody Jackson Date: Fri, 12 Jan 2024 13:45:50 -0700 Subject: [PATCH] [Chore] Update workers playground link tracking (#12505) --- assets/events.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/assets/events.ts b/assets/events.ts index 19f88b00bb0efc..7bb926eb9c478e 100644 --- a/assets/events.ts +++ b/assets/events.ts @@ -285,6 +285,7 @@ export function zarazTrackDocEvents() { const links = document.getElementsByClassName("DocsMarkdown--link"); const dropdowns = document.getElementsByTagName("details") const glossaryTooltips = document.getElementsByClassName("glossary-tooltip") + const playgroundLinks = document.getElementsByClassName("playground-link") addEventListener("DOMContentLoaded", () => { if (links.length > 0) { for (const link of links as any) { // Type cast to any for iteration @@ -322,6 +323,13 @@ export function zarazTrackDocEvents() { }); } } + if (playgroundLinks.length > 0) { + for (const playgroundLink of playgroundLinks as any) { + playgroundLink.addEventListener("click", () => { + $zarazLinkEvent('playground link click', playgroundLink); + }); + } + } }); }