Skip to content

Commit

Permalink
Adds Analytics Container to Website. (TraceMachina#1465)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusSorealheis authored Nov 6, 2024
1 parent 028c91c commit cb9d441
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion web/platform/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import starlight from "@astrojs/starlight";

import partytown from "@astrojs/partytown";
import deno from "@deno/astro-adapter";
import qwik from "@qwikdev/astro";
import tailwindcss from "@tailwindcss/vite";
// import partytown from "@astrojs/partytown";

import { rehypeMermaid } from "@beoe/rehype-mermaid"; // "rehype-mermaid";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
Expand Down Expand Up @@ -41,6 +41,7 @@ export default defineConfig({
}),
starlight(starlightConfig),
sitemap(),
partytown(),
],
markdown: {
rehypePlugins: [
Expand Down
Binary file modified web/platform/bun.lockb
Binary file not shown.
4 changes: 1 addition & 3 deletions web/platform/deno.lock

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

1 change: 1 addition & 0 deletions web/platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"devDependencies": {
"@astrojs/check": "^0.9.3",
"@astrojs/markdown-remark": "^5.1.0",
"@astrojs/partytown": "^2.1.2",
"@astrojs/react": "^3.6.2",
"@astrojs/sitemap": "^3.1.6",
"@astrojs/starlight": "^0.28.2",
Expand Down
2 changes: 2 additions & 0 deletions web/platform/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ViewTransitions from "astro/components/ViewTransitions.astro";
import { ScrollTracker } from "@qwik/components/scroll"
import { Header } from "@qwik/components/header"
import { Footer } from "@qwik/components/footer"
import GoogleTagManager from "../thirdParty/GoogleTagManager.astro"
const { title } = Astro.props;
Expand All @@ -15,6 +16,7 @@ const scrolled = false;
<html lang="en">
<head>
<meta charset="UTF-8" />
<GoogleTagManager measurementId={'GTM-NNLLRWGB'} />
<link rel="sitemap" href="/sitemap-index.xml" />
<link rel="icon" sizes="192x192" type="image/png" href="https://nativelink-cdn.s3.us-east-1.amazonaws.com/nativelink_favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" />
Expand Down
9 changes: 9 additions & 0 deletions web/platform/src/thirdParty/GoogleTagManager.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
type Props = { measurementId: string }
const props = Astro.props as Props
const measurementId = props.measurementId
---
<script
type='text/partytown'
src={`https://www.googletagmanager.com/gtag/js?id=${measurementId}`}>
</script>

0 comments on commit cb9d441

Please sign in to comment.