Socket
Socket
Sign inDemoInstall

vue-matomo

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-matomo - npm Package Compare versions

Comparing version 3.12.0-1 to 3.12.0-2

2

package.json
{
"name": "vue-matomo",
"version": "3.12.0-1",
"version": "3.12.0-2",
"description": "Link your Piwik/Matomo installation",

@@ -5,0 +5,0 @@ "author": "Dennis Ruhe <dennis@amazingsystems.nl>",

@@ -8,3 +8,3 @@ import { buildBaseUrl } from './utils'

trackInitialView: true,
trackerFileName: 'piwik',
trackerFileName: 'matomo',
trackerUrl: undefined,

@@ -40,7 +40,4 @@ userId: undefined

function initMatomo(Vue, options) {
const { host, siteId, trackerFileName, trackerUrl } = options
const trackerEndpoint = trackerUrl || `${host}/${trackerFileName}.php`;
const Matomo = window.Piwik.getAsyncTracker()
const Matomo = window.Piwik.getTracker(trackerEndpoint, siteId)
// Assign matomo to Vue

@@ -50,10 +47,2 @@ Vue.prototype.$piwik = Matomo

if (options.requireConsent) {
Matomo.requireConsent()
}
if (options.userId) {
Matomo.setUserId(options.userId)
}
if (options.trackInitialView) {

@@ -64,6 +53,2 @@ // Register first page view

if (options.enableLinkTracking) {
Matomo.enableLinkTracking()
}
// Track page navigations if router is specified

@@ -94,7 +79,25 @@ if (options.router) {

const { host, trackerFileName } = options
const { host, siteId, trackerFileName, trackerUrl } = options
const trackerScript = `${host}/${trackerFileName}.js`
const trackerEndpoint = trackerUrl || `${host}/${trackerFileName}.php`;
window._paq = window._paq || []
if (options.requireConsent) {
window._paq.push(['requireConsent'])
}
if (options.userId) {
window._paq.push(['setUserId', options.userId])
}
if (options.enableLinkTracking) {
window._paq.push(['enableLinkTracking'])
}
window._paq.push(['setTrackerUrl', trackerEndpoint])
window._paq.push(['setSiteId', siteId])
loadScript(trackerScript)
.then(() => initMatomo(Vue, options))
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc