Compare commits

...

13 Commits

7 changed files with 3658 additions and 20919 deletions

View File

@ -1,6 +1,5 @@
{
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {

View File

@ -18,11 +18,11 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: ['14']
node: ['18', '20']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
@ -34,10 +34,10 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm ci
- uses: paambaati/codeclimate-action@v2.7.5
- uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
@ -48,8 +48,8 @@ jobs:
if: success() && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'

View File

@ -4,11 +4,38 @@ All notable changes to this project will be documented in this file. Dates are d
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### [v0.16.2](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.16.1...v0.16.2)
- dependency updates, new package-lock [`fe41f55`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/fe41f551e64f9985f8f5e84104cbd396a576074e)
- bump Node.js version in CI [`729c1ce`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/729c1ce9212732248cd76f5ea6f07d1f42530191)
- test against Node.js v18 & v20 [`5df8121`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/5df812176742f5dce873c7c01bedf1680b728fe7)
#### [v0.16.1](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.16.0...v0.16.1)
> 17 August 2023
- dependency updates [`1848c2b`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/1848c2ba4ecb7aff5c9524cc6b5ab155610c86e4)
- Release 0.16.1 [`a4b1c3b`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/a4b1c3be078ba753b68fe97e6f3bd5f74fcf7893)
- update readme [`3102610`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/3102610efe82825fc81ef34921db400596f3c67f)
#### [v0.16.0](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.15.2...v0.16.0)
> 8 July 2023
- Bump eslint from 8.38.0 to 8.44.0 [`#437`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/437)
- switch default script names [`#233`](https://github.com/kremalicious/gatsby-plugin-matomo/issues/233)
- package updates [`8e84c78`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/8e84c789ba18e215c37fe1c3c55423124fb18b00)
- remove eslint-plugin-prettier [`98103c8`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/98103c87eabf6b80b421a66ad74b8a86c3c12cc2)
- Release 0.16.0 [`28ad591`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/28ad5918c73290468551f573200185cdf4389b18)
#### [v0.15.2](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.15.1...v0.15.2)
> 27 April 2023
- Bump babel-preset-gatsby-package from 3.8.0 to 3.9.0 [`#418`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/418)
- Bump vm2 from 3.9.16 to 3.9.17 [`#417`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/417)
- Bump vm2 from 3.9.15 to 3.9.16 [`#416`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/416)
- Release 0.15.2 [`d6ad15c`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/d6ad15cc1886afd916ec6d1c4a84cf86d1aa34bc)
- dependency security fix [`3974169`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/39741697066a04465e9156aa5336aae5c14ec589)
#### [v0.15.1](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.15.0...v0.15.1)

View File

@ -69,14 +69,14 @@ _NOTE: By default, this plugin only generates output when run in production mode
| `siteId` | Your Matomo site ID configured in your Matomo installation. |
| `matomoUrl` | The url of your Matomo installation. |
| `siteUrl` | The url of your site, usually the same as `siteMetadata.siteUrl`. Only used for generating the url for `noscript` image tracking fallback. |
| `matomoPhpScript` | (optional) The name of your Matomo PHP script. Defaults to `piwik.php` |
| `matomoJsScript` | (optional) The name of your Matomo JS script. Defaults to `piwik.js` |
| `matomoPhpScript` | (optional) The name of your Matomo PHP script. Defaults to `matomo.php` |
| `matomoJsScript` | (optional) The name of your Matomo JS script. Defaults to `matomo.js` |
| `exclude` | (optional) Specify an array of pathnames where tracking code will be excluded. The pathname `/offline-plugin-app-shell-fallback/` is excluded by default. |
| `requireConsent` | (optional) If true, tracking will be disabled until you call `window._paq.push(['setConsentGiven']);`. |
| `requireCookieConsent` | (optional) If true, no cookies will be stored or used until you call `window._paq.push(['setCookieConsentGiven']);`. |
| `disableCookies` | (optional) If true, no cookie will be used by Matomo. |
| `cookieDomain` | (optional) Specify cookie domain. |
| `localScript` | (optional) If set, load local `piwik.js` script from the given path, instead of loading it from your `matomoUrl`. |
| `localScript` | (optional) If set, load local `matomo.js` script from the given path, instead of loading it from your `matomoUrl`. |
| `trackLoad` | (optional) If true, it will track the loading of the matomo library. Defaults to `true`. |
| `respectDnt` | (optional) If false, will load all scripts without respecting user preference to `Do Not Track` on browsers. Defaults to `true`. |
| `dev` | (optional) Activate dev mode by setting to `true`. Will load all scripts despite not running in `production` environment. Ignores your local browser's DNT header too. Outputs some information in console about what it is doing. Useful for local testing but careful: all hits will be send like in production. |
@ -91,14 +91,14 @@ plugins: [
matomoUrl: 'https://YOUR_MATOMO_URL.COM',
siteUrl: 'https://YOUR_LIVE_SITE_URL.COM',
// All the optional settings
matomoPhpScript: 'piwik.php',
matomoJsScript: 'piwik.js',
matomoPhpScript: 'matomo.php',
matomoJsScript: 'matomo.js',
exclude: ['/offline-plugin-app-shell-fallback/'],
requireConsent: false,
requireCookieConsent: false,
disableCookies: false,
cookieDomain: '*.example.org',
localScript: '/piwik.js',
localScript: '/matomo.js',
dev: false,
enableJSErrorTracking: true,
additionalTrackers: [
@ -152,4 +152,4 @@ Say thanks with BTC:
`35UUssHexVK48jbiSgTxa4QihEoCqrwCTG`
Say thanks with ETH:
`0x04354F554536DA108726829207958d3E277f0210`
`krema.eth`

24490
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"name": "gatsby-plugin-matomo",
"description": "Gatsby plugin to add Matomo (formerly Piwik) onto a site.",
"version": "0.15.2",
"version": "0.16.2",
"author": "Matthias Kretschmann <m@kretschmann.io>",
"scripts": {
"build": "cross-env NODE_ENV=production babel src --out-dir . --ignore **/__tests__",
@ -14,18 +14,18 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@babel/cli": "^7.21.0",
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.0",
"auto-changelog": "^2.4.0",
"babel-preset-gatsby-package": "^3.8.0",
"babel-preset-gatsby-package": "^3.12.0",
"cross-env": "^7.0.3",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^2.8.7",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.0.3",
"react": "^18.2.0",
"release-it": "^15.10.1"
"release-it": "^16.2.1"
},
"homepage": "https://kremalicious.com/gatsby-plugin-matomo",
"keywords": [
@ -46,5 +46,8 @@
"repository": "github:kremalicious/gatsby-plugin-matomo",
"bugs": {
"url": "https://github.com/kremalicious/gatsby-plugin-matomo/issues"
},
"engines": {
"node": ">=18"
}
}

View File

@ -4,8 +4,8 @@ import React from 'react'
function buildTrackingCode(pluginOptions) {
const {
matomoUrl,
matomoPhpScript = 'piwik.php',
matomoJsScript = 'piwik.js',
matomoPhpScript = 'matomo.php',
matomoJsScript = 'matomo.js',
siteId,
dev,
localScript,