加入网站追踪
This commit is contained in:
1 parent
c93ec671da
commit
859c78173a
3 files changed
+39
-2
No files matched your search
+26
-1
@@ -42,8 +42,33 @@ function presetManifestPlugin(): Plugin {
|
||||
}
|
||||
}
|
||||
|
||||
function matomoAnalyticsPlugin(): Plugin {
|
||||
return {
|
||||
name: 'spine-particle-matomo',
|
||||
apply: 'build',
|
||||
transformIndexHtml() {
|
||||
return [{
|
||||
tag: 'script',
|
||||
injectTo: 'head',
|
||||
children: `
|
||||
var _paq = window._paq = window._paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//web-analysis.yeomai.site/";
|
||||
_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=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
`,
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue(), presetManifestPlugin()],
|
||||
plugins: [vue(), presetManifestPlugin(), matomoAnalyticsPlugin()],
|
||||
build: {
|
||||
sourcemap: false,
|
||||
rollupOptions: {
|
||||
|
||||
Reference in new issue
Block a user