Skip to content

Commit

Permalink
add matomo (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
CritasWang authored Mar 25, 2024
1 parent fc814d4 commit f8d6db8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 23 deletions.
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"@docsearch/react": "^3.5.2",
"@vuepress/client": "2.0.0-rc.0",
"@vuepress/plugin-docsearch": "2.0.0-rc.0",
"@vuepress/plugin-google-analytics": "2.0.0-rc.0",
"@vuepress/shared": "2.0.0-rc.0",
"@vuepress/utils": "2.0.0-rc.0",
"gh-pages": "^6.1.1",
Expand Down
15 changes: 0 additions & 15 deletions docs/pnpm-lock.yaml

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

3 changes: 0 additions & 3 deletions docs/src/.vuepress/components/PageFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
Apache and the Apache feather logo are trademarks of The Apache Software Foundation</p>
<p style="text-align: center; margin-top: 10px; color: #909399; font-size: 12px; margin: 0 30px;">
<strong>Have a question?</strong> Connect with us on issues. </p>
<p style="text-align: center; margin-top: 10px; color: #909399; font-size: 12px; margin: 0 30px;">
We use <a href="https://analytics.google.com">Google Analytics</a> to collect anonymous, aggregated usage information.
</p>
</footer>
</template>
<script setup lang="ts">
Expand Down
19 changes: 15 additions & 4 deletions docs/src/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import { getDirname, path } from '@vuepress/utils';
import { defineUserConfig } from "vuepress";
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics';
import { docsearchPlugin } from './components/docsearch/node/index.js';
import theme from "./theme.js";

Expand All @@ -42,6 +41,21 @@ export default defineUserConfig({
theme,
head: [
['link', { rel: 'icon', href: '/favicon.ico' }],
['script', { type: 'text/javascript' }, `
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.apache.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '53']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
`],
],
alias: {
'@theme-hope/components/PageFooter': path.resolve(
Expand Down Expand Up @@ -103,9 +117,6 @@ export default defineUserConfig({
},
},
}),
googleAnalyticsPlugin({
id: 'G-5MM3J6X84E',
}),
],
// Enable it with pwa
// shouldPrefetch: false,
Expand Down

0 comments on commit f8d6db8

Please sign in to comment.