✨ add better tracking
This commit is contained in:
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -1,3 +1,5 @@
|
|||||||
{
|
{
|
||||||
"editor.formatOnSave": false
|
"editor.formatOnSave": false,
|
||||||
|
"vue-i18n-ally.localesPaths": "locales",
|
||||||
|
"i18n-ally.localesPaths": "locales"
|
||||||
}
|
}
|
||||||
|
|||||||
19
app.html
19
app.html
@@ -2,25 +2,6 @@
|
|||||||
<html {{ HTML_ATTRS }}>
|
<html {{ HTML_ATTRS }}>
|
||||||
<head {{ HEAD_ATTRS }}>
|
<head {{ HEAD_ATTRS }}>
|
||||||
{{ HEAD }}
|
{{ HEAD }}
|
||||||
<!-- Matomo -->
|
|
||||||
<script type="text/javascript">
|
|
||||||
var _paq = window._paq || [];
|
|
||||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
|
||||||
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
|
|
||||||
_paq.push(["setCookieDomain", "*.webgems.io"]);
|
|
||||||
_paq.push(["setDomains", ["*.webgems.io"]]);
|
|
||||||
_paq.push(['trackPageView']);
|
|
||||||
_paq.push(['enableLinkTracking']);
|
|
||||||
(function() {
|
|
||||||
var u="//stats.lost.services/";
|
|
||||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
|
||||||
_paq.push(['setSiteId', '1']);
|
|
||||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
|
||||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
<noscript><p><img src="//stats.lost.services/matomo.php?idsite=1&rec=1" style="border:0;" alt="" /></p></noscript>
|
|
||||||
<!-- End Matomo Code -->
|
|
||||||
</head>
|
</head>
|
||||||
<body {{ BODY_ATTRS }}>
|
<body {{ BODY_ATTRS }}>
|
||||||
{{ APP }}
|
{{ APP }}
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ export default {
|
|||||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||||
{ hid: 'description', name: 'description', content: pkg.description },
|
{ hid: 'description', name: 'description', content: pkg.description },
|
||||||
{ hid: 'keywords', name: 'keywords', content: 'css, html, php, server, resources, design, gems, nuxt, javascript, tutorials, development, software'},
|
{ hid: 'keywords', name: 'keywords', content: 'css, html, php, server, resources, design, gems, nuxt, javascript, tutorials, development, software'},
|
||||||
|
|
||||||
{ name: 'robots', content: 'index, follow' },
|
{ name: 'robots', content: 'index, follow' },
|
||||||
{ name: 'distribution', content: 'global'},
|
{ name: 'distribution', content: 'global'},
|
||||||
|
|
||||||
{ name:'theme-color', content: '#ffffff' },
|
{ name:'theme-color', content: '#ffffff' },
|
||||||
{ name: 'msapplication-TileColor', content: '#da532c' },
|
{ name: 'msapplication-TileColor', content: '#da532c' },
|
||||||
{ rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#5bbad5' },
|
{ rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#5bbad5' },
|
||||||
@@ -62,6 +62,10 @@ export default {
|
|||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
'~/plugins/i18n.js',
|
'~/plugins/i18n.js',
|
||||||
|
{
|
||||||
|
src: '~/plugins/vue-matomo.js',
|
||||||
|
ssr: false,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
/*
|
/*
|
||||||
** Nuxt.js modules
|
** Nuxt.js modules
|
||||||
|
|||||||
7
package-lock.json
generated
7
package-lock.json
generated
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "webgems",
|
"name": "webgems.io",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
@@ -11126,6 +11126,11 @@
|
|||||||
"vue-style-loader": "^4.1.0"
|
"vue-style-loader": "^4.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"vue-matomo": {
|
||||||
|
"version": "3.12.0-5",
|
||||||
|
"resolved": "https://registry.npmjs.org/vue-matomo/-/vue-matomo-3.12.0-5.tgz",
|
||||||
|
"integrity": "sha512-n69Nmry7Eg0vooGlEMViaAbjsMGM5Hfno0G9C0o8q5aNIShzez5h2JCLRdHktC1ZdI7p4Wtg0csm++zIO+tWCQ=="
|
||||||
|
},
|
||||||
"vue-meta": {
|
"vue-meta": {
|
||||||
"version": "1.6.0",
|
"version": "1.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-1.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-1.6.0.tgz",
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
"nuxt": "^2.4.0",
|
"nuxt": "^2.4.0",
|
||||||
"nuxt-clipboard2": "^0.2.1",
|
"nuxt-clipboard2": "^0.2.1",
|
||||||
"vue-i18n": "^8.11.2"
|
"vue-i18n": "^8.11.2",
|
||||||
|
"vue-matomo": "^3.12.0-5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^8.6.4",
|
"autoprefixer": "^8.6.4",
|
||||||
|
|||||||
34
plugins/vue-matomo.js
Normal file
34
plugins/vue-matomo.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import VueMatomo from 'vue-matomo'
|
||||||
|
|
||||||
|
export default ({
|
||||||
|
app,
|
||||||
|
}) => {
|
||||||
|
Vue.use(VueMatomo, {
|
||||||
|
router: app.router,
|
||||||
|
// Configure your matomo server and site by providing
|
||||||
|
host: 'https://stats.lost.services',
|
||||||
|
siteId: 1,
|
||||||
|
|
||||||
|
// Changes the default .js and .php endpoint's filename
|
||||||
|
// Default: 'piwik'
|
||||||
|
trackerFileName: 'matomo',
|
||||||
|
|
||||||
|
// Enables link tracking on regular links. Note that this won't
|
||||||
|
// work for routing links (ie. internal Vue router links)
|
||||||
|
// Default: true
|
||||||
|
enableLinkTracking: true,
|
||||||
|
|
||||||
|
// Require consent before sending tracking information to matomo
|
||||||
|
// Default: false
|
||||||
|
requireConsent: false,
|
||||||
|
|
||||||
|
// Whether to track the initial page view
|
||||||
|
// Default: true
|
||||||
|
trackInitialView: true,
|
||||||
|
|
||||||
|
// Whether or not to log debug information
|
||||||
|
// Default: false
|
||||||
|
debug: false,
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user