Skip to content

Commit 592062d

Browse files
authored
Add plausible tracking to docs pages (#926)
1 parent 10e6a93 commit 592062d

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

docs/src/components/starlight/Head.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Includes proper favicon and meta tags matching the main site
55
*/
66
import Default from "@astrojs/starlight/components/Head.astro";
7+
import PlausibleAnalytics from "@/components/PlausibleAnalytics.astro";
78
---
89

910
<Default {...Astro.props}><slot /></Default>
@@ -20,3 +21,5 @@ import Default from "@astrojs/starlight/components/Head.astro";
2021

2122
<!-- Additional meta for better SEO -->
2223
<meta name="author" content="RocketSim" />
24+
25+
<PlausibleAnalytics />

docs/src/layouts/Base.astro

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Footer from "@/partials/Footer.astro";
88
import Header from "@/partials/Header.astro";
99
import "@/styles/main.css";
1010
import { ClientRouter } from "astro:transitions";
11+
import PlausibleAnalytics from "@/components/PlausibleAnalytics.astro";
1112
1213
// types for frontmatters
1314
export interface Props {
@@ -74,24 +75,7 @@ const { seo, structuredData } = Astro.props;
7475
</script>
7576
<!-- End Google Tag Manager -->
7677

77-
<!-- Privacy-friendly analytics by Plausible -->
78-
<script
79-
is:inline
80-
defer
81-
src="https://plausible.io/js/pa-UU6kf044LfXx1I_nLu86Q.js"></script>
82-
<script>
83-
((window.plausible =
84-
window.plausible ||
85-
function () {
86-
(plausible.q = plausible.q || []).push(arguments);
87-
}),
88-
(plausible.init =
89-
plausible.init ||
90-
function (i: any) {
91-
plausible.o = i || {};
92-
}));
93-
plausible.init();
94-
</script>
78+
<PlausibleAnalytics />
9579
<script>
9680
/// This adds event listeners to our inline forms
9781
/// and sends an event to Plausible.
@@ -108,7 +92,6 @@ const { seo, structuredData } = Astro.props;
10892
);
10993
})();
11094
</script>
111-
<!-- End Plausible -->
11295

11396
<!-- ConvertKit Insights -->
11497
<script type="text/javascript" is:inline>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!-- Privacy-friendly analytics by Plausible -->
2+
<script
3+
is:inline
4+
defer
5+
src="https://plausible.io/js/pa-UU6kf044LfXx1I_nLu86Q.js"></script>
6+
<script is:inline>
7+
((window.plausible =
8+
window.plausible ||
9+
function () {
10+
(plausible.q = plausible.q || []).push(arguments);
11+
}),
12+
(plausible.init =
13+
plausible.init ||
14+
function (i) {
15+
plausible.o = i || {};
16+
}));
17+
plausible.init();
18+
</script>

0 commit comments

Comments
 (0)