Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] replace googletagmanager to matomo #2877

Merged
merged 17 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions home/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ module.exports = {
locales: ['zh-cn', 'en'],
},
themeConfig: {
matomo: {
matomoUrl: 'https://analytics.apache.org/',
siteId: '67',
phpLoader: 'matomo.php',
jsLoader: 'matomo.js',
},
image: '/img/hertzbeat-logo.svg',
liveCodeBlock: {
playgroundPosition: 'bottom',
Expand Down Expand Up @@ -344,6 +350,7 @@ module.exports = {
fromExtensions: ['html'],
},
],
'docusaurus-plugin-matomo',
'@docusaurus/plugin-ideal-image',
[
'@docusaurus/plugin-pwa',
Expand Down
5 changes: 3 additions & 2 deletions home/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"aos": "^2.3.4",
"clsx": "1.2.1",
"color": "3.2.1",
"docusaurus-plugin-matomo": "^0.0.8",
"file-loader": "6.2.0",
"markdownlint-cli2": "^0.13.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-slick": "0.29.0",
Expand All @@ -41,8 +43,7 @@
"swiper": "7.4.1",
"url-loader": "4.1.1",
"workbox-routing": "6.5.3",
"workbox-strategies": "6.5.3",
"markdownlint-cli2": "^0.13.0"
"workbox-strategies": "6.5.3"
},
"browserslist": {
"production": [
Expand Down
20 changes: 14 additions & 6 deletions web-app/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<style type="text/css">.preloader{position:fixed;top:0;left:0;width:100%;height:100%;overflow:hidden;background:#c192c7;z-index:9999;transition:opacity .65s}.preloader-hidden-add{opacity:1;display:block}.preloader-hidden-add-active{opacity:0}.preloader-hidden{display:none}.cs-loader{position:absolute;top:0;left:0;height:100%;width:100%}.cs-loader-inner{transform:translateY(-50%);top:50%;position:absolute;width:100%;color:#fff;text-align:center}.cs-loader-inner label{font-size:20px;opacity:0;display:inline-block}@keyframes lol{0%{opacity:0;transform:translateX(-300px)}33%{opacity:1;transform:translateX(0)}66%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(300px)}}.cs-loader-inner label:nth-child(6){animation:lol 3s infinite ease-in-out}.cs-loader-inner label:nth-child(5){animation:lol 3s .1s infinite ease-in-out}.cs-loader-inner label:nth-child(4){animation:lol 3s .2s infinite ease-in-out}.cs-loader-inner label:nth-child(3){animation:lol 3s .3s infinite ease-in-out}.cs-loader-inner label:nth-child(2){animation:lol 3s .4s infinite ease-in-out}.cs-loader-inner label:nth-child(1){animation:lol 3s .5s infinite ease-in-out}</style>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-13PPZZ7P4Y"></script>
<!-- Matomo -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-13PPZZ7P4Y');
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://analytics.apache.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '67']);
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);
})();
</script>
<!-- End Matomo Code -->

</head>
<body>
<app-root></app-root>
Expand Down
Loading