mirror of
https://github.com/kremalicious/gatsby-plugin-matomo.git
synced 2024-12-22 09:13:19 +01:00
package updates
This commit is contained in:
parent
30a58365bf
commit
aeeffda980
16
package.json
16
package.json
@ -16,18 +16,18 @@
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.8.4",
|
||||
"@babel/core": "^7.8.4",
|
||||
"@babel/runtime": "^7.8.4",
|
||||
"@babel/core": "^7.9.0",
|
||||
"@babel/runtime": "^7.9.2",
|
||||
"auto-changelog": "^1.16.2",
|
||||
"babel-preset-gatsby-package": "^0.2.16",
|
||||
"cross-env": "^7.0.0",
|
||||
"babel-preset-gatsby-package": "^0.2.18",
|
||||
"cross-env": "^7.0.2",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-prettier": "^6.10.0",
|
||||
"eslint-config-prettier": "^6.10.1",
|
||||
"eslint-plugin-prettier": "^3.1.2",
|
||||
"jest": "^25.1.0",
|
||||
"prettier": "^1.19.1",
|
||||
"react": "^16.12.0",
|
||||
"release-it": "^12.6.1"
|
||||
"prettier": "^2.0.1",
|
||||
"react": "^16.13.1",
|
||||
"release-it": "^13.1.2"
|
||||
},
|
||||
"homepage": "https://kremalicious.com/gatsby-plugin-matomo",
|
||||
"keywords": [
|
||||
|
@ -23,7 +23,7 @@ describe('gatsby-plugin-google-analytics', () => {
|
||||
process.env.NODE_ENV = env
|
||||
})
|
||||
|
||||
const setup = options => {
|
||||
const setup = (options) => {
|
||||
const setHeadComponents = jest.fn()
|
||||
const setPostBodyComponents = jest.fn()
|
||||
|
||||
|
@ -23,10 +23,10 @@ function buildTrackingCode(pluginOptions) {
|
||||
${requireConsent ? "window._paq.push(['requireConsent']);" : ''}
|
||||
${disableCookies ? "window._paq.push(['disableCookies']);" : ''}
|
||||
${
|
||||
cookieDomain
|
||||
? `window._paq.push(['setCookieDomain', '${cookieDomain}']);`
|
||||
: ''
|
||||
}
|
||||
cookieDomain
|
||||
? `window._paq.push(['setCookieDomain', '${cookieDomain}']);`
|
||||
: ''
|
||||
}
|
||||
window._paq.push(['setTrackerUrl', '${matomoUrl}/${matomoPhpScript}']);
|
||||
window._paq.push(['setSiteId', '${siteId}']);
|
||||
window._paq.push(['enableHeartBeatTimer']);
|
||||
@ -53,9 +53,15 @@ function buildTrackingCode(pluginOptions) {
|
||||
}
|
||||
|
||||
function buildTrackingCodeNoJs(pluginOptions, pathname) {
|
||||
const { matomoUrl, matomoPhpScript = 'piwik.php', siteId, siteUrl } = pluginOptions
|
||||
const html = `<img src="${matomoUrl}/${matomoPhpScript}?idsite=${siteId}&rec=1&url=${siteUrl +
|
||||
pathname}" style="border:0" alt="tracker" />`
|
||||
const {
|
||||
matomoUrl,
|
||||
matomoPhpScript = 'piwik.php',
|
||||
siteId,
|
||||
siteUrl
|
||||
} = pluginOptions
|
||||
const html = `<img src="${matomoUrl}/${matomoPhpScript}?idsite=${siteId}&rec=1&url=${
|
||||
siteUrl + pathname
|
||||
}" style="border:0" alt="tracker" />`
|
||||
|
||||
return (
|
||||
<noscript
|
||||
@ -83,12 +89,12 @@ export const onRenderBody = (
|
||||
let excludePaths = ['/offline-plugin-app-shell-fallback/']
|
||||
|
||||
if (pluginOptions && typeof pluginOptions.exclude !== 'undefined') {
|
||||
pluginOptions.exclude.map(exclude => {
|
||||
pluginOptions.exclude.map((exclude) => {
|
||||
excludePaths.push(exclude)
|
||||
})
|
||||
}
|
||||
|
||||
const isPathExcluded = excludePaths.some(path => pathname === path)
|
||||
const isPathExcluded = excludePaths.some((path) => pathname === path)
|
||||
|
||||
if (
|
||||
(isProduction || (pluginOptions && pluginOptions.dev === true)) &&
|
||||
|
Loading…
Reference in New Issue
Block a user