Skip to content

Commit 12ecf92

Browse files
committed
[Docs site] Add tracking events
1 parent cd1147b commit 12ecf92

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

src/components/CopyPageButton.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
PiCheckCircleLight,
1717
PiXCircleLight,
1818
} from "react-icons/pi";
19+
import { track } from "~/util/zaraz";
1920

2021
type CopyState = "idle" | "success" | "error";
2122

@@ -40,6 +41,9 @@ export default function CopyPageButton() {
4041

4142
const handleViewMarkdown = () => {
4243
const markdownUrl = new URL("index.md", window.location.href).toString();
44+
track("clicked copy page button", {
45+
value: "view markdown",
46+
});
4347
window.open(markdownUrl, "_blank");
4448
};
4549

@@ -54,6 +58,9 @@ export default function CopyPageButton() {
5458

5559
const markdown = await response.text();
5660
await navigator.clipboard.writeText(markdown);
61+
track("clicked copy page button", {
62+
value: "copy markdown",
63+
});
5764

5865
setCopyState("success");
5966
setTimeout(() => {

src/components/SubtractIPCalculator.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useEffect, useState } from "react";
22
import { excludeCidr, parseCidr } from "cidr-tools";
3+
import { track } from "~/util/zaraz";
34

45
export default function SubtractIPCalculator({
56
defaults,
@@ -16,6 +17,7 @@ export default function SubtractIPCalculator({
1617

1718
function calculate() {
1819
setResult(excludeCidr(base, exclude));
20+
track("clicked calculator submit");
1921
}
2022

2123
function disableButton() {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: R2 Data Catalog
2+
3+
product:
4+
title: R2 Data Catalog
5+
url: /r2/data-catalog/
6+
group: Developer platform
7+
additional_groups: [Storage]
8+
9+
meta:
10+
title: Cloudflare R2 Data Catalog docs
11+
description: Create, manage, and query Iceberg tables stored in R2.
12+
author: "@cloudflare"
13+
14+
resources:
15+
community: https://community.cloudflare.com/c/developers/workers/40
16+
dashboard_link: https://dash.cloudflare.com/?to=/:account/r2
17+
discord: https://discord.com/channels/595317990191398933/940663374377783388
18+
learning_center: https://www.cloudflare.com/learning/cloud/what-is-object-storage/

0 commit comments

Comments
 (0)