We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bebf1f commit 3a48c1eCopy full SHA for 3a48c1e
src/components/overrides/TableOfContents.astro
@@ -18,6 +18,7 @@ const tags = Astro.locals.starlightRoute.entry.data.tags;
18
<a
19
href={`/search/?tags=${tag}`}
20
class="rounded-sm border border-(--sl-color-hairline) px-3 text-black"
21
+ data-tag-serp-link={true}
22
>
23
{tag}
24
</a>
src/scripts/analytics/links.ts
@@ -16,6 +16,14 @@ export function registerLinks() {
16
for (const el of elements) {
17
const { hostname, pathname } = new URL(el.href);
+ if (el.dataset.tagSerpLink) {
+ el.addEventListener("click", () => {
+ track("click docs tag", { value: el.innerText });
+ });
+
+ continue;
25
+ }
26
27
if (hostname === "developers.cloudflare.com" || hostname === "localhost") {
28
continue;
29
}
0 commit comments