Skip to content

Commit c9ee5fa

Browse files
committed
add matomo analytics component
Signed-off-by: Jess Chitas <[email protected]>
1 parent daefeb4 commit c9ee5fa

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/components/Matomo/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var _paq = (window._paq = window._paq || []);
2+
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
3+
_paq.push(["trackPageView"]);
4+
_paq.push(["enableLinkTracking"]);
5+
(function () {
6+
var u = "//analytics.ossupstream.org/";
7+
_paq.push(["setTrackerUrl", u + "matomo.php"]);
8+
_paq.push(["setSiteId", "6"]);
9+
var d = document,
10+
g = d.createElement("script"),
11+
s = d.getElementsByTagName("script")[0];
12+
g.async = true;
13+
g.src = u + "matomo.js";
14+
s.parentNode.insertBefore(g, s);
15+
})();

src/pages/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import Welcome from '@site/src/components/Welcome'
55
import Install from '@site/src/components/Install'
66
import Demo from '@site/src/components/Demo'
77
import About from '@site/src/components/About'
8+
9+
import Matomo from '@site/src/components/Matomo'
810
import VideoEmbed from '@site/src/components/VideoEmbed'
911

1012
export default function Home() {
@@ -13,6 +15,7 @@ export default function Home() {
1315
<Layout
1416
title={`Welcome to the ${siteConfig.title} website!`}
1517
description="llm-d: a Kubernetes-native high-performance distributed LLM inference framework">
18+
<script src={Matomo} />
1619
<main>
1720
<Welcome />
1821

0 commit comments

Comments
 (0)