mirror of
https://github.com/audacity/audacity.github.io.git
synced 2026-04-21 19:27:51 -05:00
Install Matomo React
This commit is contained in:
17
package-lock.json
generated
17
package-lock.json
generated
@@ -10,6 +10,7 @@
|
||||
"dependencies": {
|
||||
"@astrojs/react": "^2.0.2",
|
||||
"@astrojs/tailwind": "^3.0.1",
|
||||
"@datapunt/matomo-tracker-react": "^0.5.1",
|
||||
"@types/react": "^18.0.28",
|
||||
"@types/react-dom": "^18.0.10",
|
||||
"astro": "^2.0.10",
|
||||
@@ -506,6 +507,22 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@datapunt/matomo-tracker-js": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@datapunt/matomo-tracker-js/-/matomo-tracker-js-0.5.1.tgz",
|
||||
"integrity": "sha512-9/MW9vt/BA5Db7tO6LqCeQKtuvBNjyq51faF3AzUmPMlYsJCnASIxcut3VqJKiribhUoey7aYbPIYuj9x4DLPA=="
|
||||
},
|
||||
"node_modules/@datapunt/matomo-tracker-react": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@datapunt/matomo-tracker-react/-/matomo-tracker-react-0.5.1.tgz",
|
||||
"integrity": "sha512-lrNYM9hFL6XK0VAdtMb7MwZrLWhaAconx4c7gOGAMvoWuoVm+ZZIYFuKtfYdYMeBf0avxWtmKRwjZEg7T8jV2A==",
|
||||
"dependencies": {
|
||||
"@datapunt/matomo-tracker-js": "^0.5.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">= 16.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emmetio/abbreviation": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.2.3.tgz",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"dependencies": {
|
||||
"@astrojs/react": "^2.0.2",
|
||||
"@astrojs/tailwind": "^3.0.1",
|
||||
"@datapunt/matomo-tracker-react": "^0.5.1",
|
||||
"@types/react": "^18.0.28",
|
||||
"@types/react-dom": "^18.0.10",
|
||||
"astro": "^2.0.10",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
import { MatomoProvider, createInstance } from "@datapunt/matomo-tracker-react";
|
||||
import Footer from "../components/footer/Footer.astro";
|
||||
import NavigationReact from "../components/navigation/NavigationReact";
|
||||
|
||||
@@ -6,6 +7,11 @@ export interface Props {
|
||||
title: string;
|
||||
}
|
||||
const { title } = Astro.props;
|
||||
|
||||
const instance = createInstance({
|
||||
urlBase: 'https://audacity.github.io',
|
||||
siteId: 3,
|
||||
})
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
@@ -16,30 +22,11 @@ const { title } = Astro.props;
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{title}</title>
|
||||
|
||||
<!-- Matomo -->
|
||||
<script>
|
||||
var _paq = (window._paq = window._paq || []);
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(["trackPageView"]);
|
||||
_paq.push(["enableLinkTracking"]);
|
||||
(function () {
|
||||
var u = "https://audacity.matomo.cloud/";
|
||||
_paq.push(["setTrackerUrl", u + "matomo.php"]);
|
||||
_paq.push(["setSiteId", "2"]);
|
||||
var d = document,
|
||||
g = d.createElement("script"),
|
||||
s = d.getElementsByTagName("script")[0];
|
||||
g.async = true;
|
||||
g.src = "//cdn.matomo.cloud/audacity.matomo.cloud/matomo.js";
|
||||
s.parentNode.insertBefore(g, s);
|
||||
})();
|
||||
</script>
|
||||
<!-- End Matomo Code -->
|
||||
</head>
|
||||
<body>
|
||||
<MatomoProvider value={instance}>
|
||||
<NavigationReact client:load />
|
||||
<slot />
|
||||
<Footer />
|
||||
</body>
|
||||
</MatomoProvider>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user