Skip to content

Commit

Permalink
feat: TAR-110 add datadog tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Chattox committed Apr 24, 2024
1 parent 3550c38 commit 06c3ad0
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
PUBLIC_APTRINSIC_APP_ID=
PUBLIC_APTRINSIC_APP_ID=
PUBLIC_DATADOG_TOKEN=
PUBLIC_DATADOG_ID=
PUBLIC_DATADOG_ENV=
31 changes: 31 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"test:ci": "jest src --ci"
},
"dependencies": {
"@datadog/browser-rum": "^5.16.0",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@fontsource/ibm-plex-sans": "^5.0.18",
Expand Down
28 changes: 28 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
import { datadogRum } from "@datadog/browser-rum";
import { SeoMetaTags } from "./components/SeoMetaTags/SeoMetaTags";
import Theme from "./components/Theme";
import { WithExtensionContext } from "./hooks/withExtensionContext";
import { useEffect } from "react";

function App() {
useEffect(() => {
const ddToken = import.meta.env.PUBLIC_DATADOG_TOKEN;
const ddId = import.meta.env.PUBLIC_DATADOG_ID;
const ddEnv = import.meta.env.PUBLIC_DATADOG_ENV;

if (ddToken && ddId && ddEnv) {
datadogRum.init({
applicationId: ddId,
clientToken: ddToken,
env: ddEnv,
site: "datadoghq.com",
service: "dc-extension-seo-meta-tags",
version: "1.1.0",
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
defaultPrivacyLevel: "allow",
sessionSampleRate: 100,
usePartitionedCrossSiteSessionCookie: true,
proxy: "https://dd-proxy.amplience.net",
});

datadogRum.startSessionReplayRecording();
}
}, []);

return (
<WithExtensionContext>
<Theme>
Expand Down

0 comments on commit 06c3ad0

Please sign in to comment.