Compare commits
148 Commits
Author | SHA1 | Date |
---|---|---|
Matthias Kretschmann | a1d4da6c10 | |
Matthias Kretschmann | 5df8121767 | |
Matthias Kretschmann | 729c1ce921 | |
Matthias Kretschmann | fe41f551e6 | |
Matthias Kretschmann | a4b1c3be07 | |
Matthias Kretschmann | 1848c2ba4e | |
Matthias Kretschmann | 3102610efe | |
Matthias Kretschmann | 28ad5918c7 | |
Matthias Kretschmann | d9a22c2467 | |
Matthias Kretschmann | 5b5f35aaf7 | |
Matthias Kretschmann | 98103c87ea | |
Matthias Kretschmann | 8e84c789ba | |
dependabot[bot] | 3a28ad96cf | |
Matthias Kretschmann | d6ad15cc18 | |
Matthias Kretschmann | 3974169706 | |
dependabot[bot] | d3b1c8be41 | |
dependabot[bot] | 38ae6bbe5e | |
dependabot[bot] | 1041dc1d08 | |
Matthias Kretschmann | 42a33207b3 | |
Matthias Kretschmann | 3d087e4e33 | |
dependabot[bot] | 5f53ac84e8 | |
dependabot[bot] | 80db297e5d | |
dependabot[bot] | 8701024764 | |
dependabot[bot] | 122b0b0a9c | |
dependabot[bot] | 219233aeaa | |
dependabot[bot] | 6bbba8bb6e | |
Matthias Kretschmann | 6919fc6b1a | |
dependabot[bot] | 22f44b3992 | |
dependabot[bot] | b4d87fc90b | |
dependabot[bot] | cc7060a6a3 | |
dependabot[bot] | fd155c76a2 | |
dependabot[bot] | 9fdf75d8e8 | |
dependabot[bot] | 02fe5363e5 | |
Fabio Bonelli | 7d921386fa | |
dependabot[bot] | 197a17ec1e | |
dependabot[bot] | a6065d77e8 | |
dependabot[bot] | 2600a06cf0 | |
dependabot[bot] | 5ee2e47483 | |
dependabot[bot] | 906ac45a80 | |
dependabot[bot] | dd52ef0be5 | |
dependabot[bot] | 08cca8a23b | |
dependabot[bot] | 42c2a5c8d2 | |
dependabot[bot] | 67d9f66bf1 | |
dependabot[bot] | 682f304fdd | |
dependabot[bot] | 36f5e0fa2f | |
dependabot[bot] | 81598dc6e6 | |
dependabot[bot] | 094ec63279 | |
dependabot[bot] | 4f2f6af1a5 | |
dependabot[bot] | 72677940e7 | |
dependabot[bot] | 8cb95ddd09 | |
dependabot[bot] | 7baa8f2414 | |
dependabot[bot] | 6796116e3d | |
dependabot[bot] | e91d9e76b1 | |
dependabot[bot] | 21283c227c | |
dependabot[bot] | 63a1e972d6 | |
dependabot[bot] | fd449b9c8c | |
dependabot[bot] | c4da8d2330 | |
dependabot[bot] | db26707a19 | |
Matthias Kretschmann | 469302ae6b | |
Matthias Kretschmann | d02b3dddbb | |
dependabot[bot] | a4595803f7 | |
dependabot[bot] | 65a5348dc6 | |
dependabot[bot] | 98ab771e86 | |
dependabot[bot] | dd67dd5eee | |
dependabot[bot] | 072df8c184 | |
dependabot[bot] | a912a3a299 | |
dependabot[bot] | 14bb285d01 | |
dependabot[bot] | 00cb12a4c4 | |
dependabot[bot] | 278c5007a0 | |
dependabot[bot] | 9be9a4d1b4 | |
dependabot[bot] | 3e82af65af | |
dependabot[bot] | 567b3ffbc4 | |
dependabot[bot] | 70c762f923 | |
dependabot[bot] | bc0596d7bb | |
dependabot[bot] | 29068f2d27 | |
dependabot[bot] | b214491c17 | |
dependabot[bot] | 6245a15c5b | |
dependabot[bot] | f0883569f5 | |
dependabot[bot] | ffe5d5f39e | |
dependabot[bot] | 6664048940 | |
dependabot[bot] | dcd1392a8f | |
dependabot[bot] | 50927c9cd7 | |
dependabot[bot] | 26c0b912b6 | |
dependabot[bot] | 0812596af2 | |
dependabot[bot] | ade4960782 | |
dependabot[bot] | 312ebbba26 | |
dependabot[bot] | 42438c40fc | |
dependabot[bot] | 9e9b8af135 | |
dependabot[bot] | 13e3597426 | |
dependabot[bot] | fda3499bbb | |
dependabot[bot] | ccd387252a | |
dependabot[bot] | 057c3d655c | |
dependabot[bot] | 96323976b6 | |
dependabot[bot] | 57fec52166 | |
dependabot[bot] | c695cbe7a6 | |
Matthias Kretschmann | 5bda1a1777 | |
Matthias Kretschmann | ac8dd7df43 | |
Matthias Kretschmann | 3565e9aa9c | |
dependabot[bot] | 41d7924925 | |
dependabot[bot] | 8a37114beb | |
dependabot[bot] | 0395fff0f7 | |
dependabot[bot] | b434fe9d4a | |
dependabot[bot] | d294bfcc31 | |
dependabot[bot] | 649798999e | |
dependabot[bot] | 6ad8dfaa8c | |
dependabot[bot] | 056ab7b3f9 | |
dependabot[bot] | fc77281938 | |
dependabot[bot] | e81a393127 | |
dependabot[bot] | b89159f923 | |
Matthias Kretschmann | 9fa4413143 | |
Matthias Kretschmann | 8bfa9d3b32 | |
Matthias Kretschmann | b4efe1dfb0 | |
dependabot[bot] | 3253556ca5 | |
dependabot[bot] | f8f6e76727 | |
dependabot[bot] | 7dbf7d65df | |
dependabot[bot] | 9342ca4fc2 | |
dependabot[bot] | 63b8330034 | |
dependabot[bot] | 5f25b22e47 | |
dependabot[bot] | ff0a9c9138 | |
dependabot[bot] | 124c28fe06 | |
dependabot[bot] | 4bc86115a4 | |
dependabot[bot] | 3aa782ac6f | |
dependabot[bot] | 0e3b2a199d | |
dependabot[bot] | 176e2d9806 | |
dependabot[bot] | c17c8581a5 | |
dependabot[bot] | 01cda2eb30 | |
dependabot[bot] | e68cbe0c23 | |
dependabot[bot] | 7df0a6b6d3 | |
dependabot[bot] | b7d71632e0 | |
dependabot[bot] | 7a90f0e9bd | |
dependabot[bot] | efe0702942 | |
dependabot[bot] | 7a8d1acdd5 | |
dependabot[bot] | f0d8014000 | |
dependabot[bot] | 3db280cf97 | |
dependabot[bot] | f5bbb477c8 | |
dependabot[bot] | cfeeda2b94 | |
dependabot[bot] | 91ae2a2c55 | |
dependabot[bot] | 168c8f9977 | |
dependabot[bot] | ddbe9b9b7f | |
dependabot[bot] | 1c7ee9b798 | |
dependabot[bot] | 8ca03e5289 | |
Matthias Kretschmann | b6d51f76cc | |
dependabot[bot] | 2cae886661 | |
dependabot[bot] | 8a101974a4 | |
dependabot[bot] | 051f6388a2 | |
dependabot[bot] | 03ad73ce0c | |
dependabot[bot] | 5b887a0574 | |
dependabot[bot] | 1c36ee694b |
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
|
||||
"plugins": ["prettier"],
|
||||
"extends": ["eslint:recommended", "prettier"],
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ main ]
|
||||
schedule:
|
||||
- cron: '24 18 * * 2'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
200
CHANGELOG.md
200
CHANGELOG.md
|
@ -4,15 +4,213 @@ 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)
|
||||
|
||||
> 12 April 2023
|
||||
|
||||
- Bump prettier from 2.8.4 to 2.8.7 [`#407`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/407)
|
||||
- Bump jest-environment-jsdom from 29.4.3 to 29.5.0 [`#406`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/406)
|
||||
- Bump release-it from 15.9.0 to 15.10.0 [`#411`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/411)
|
||||
- Bump eslint-config-prettier from 8.6.0 to 8.8.0 [`#408`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/408)
|
||||
- Bump babel-preset-gatsby-package from 3.7.0 to 3.8.0 [`#409`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/409)
|
||||
- Bump vm2 from 3.9.11 to 3.9.15 [`#412`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/412)
|
||||
- dependency updates [`3d087e4`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/3d087e4e33ed0fc05d49a5889a12354a4083101d)
|
||||
- Release 0.15.1 [`42a3320`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/42a33207b303bb7f0442cab787f8d0d2b3f50d7a)
|
||||
|
||||
#### [v0.15.0](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.14.0...v0.15.0)
|
||||
|
||||
> 23 March 2023
|
||||
|
||||
- Bump prettier from 2.8.3 to 2.8.4 [`#391`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/391)
|
||||
- Bump eslint from 8.33.0 to 8.36.0 [`#401`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/401)
|
||||
- Bump release-it from 15.6.0 to 15.9.0 [`#405`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/405)
|
||||
- Bump webpack from 5.75.0 to 5.76.1 [`#404`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/404)
|
||||
- Bump @babel/cli from 7.20.7 to 7.21.0 [`#399`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/399)
|
||||
- Bump babel-preset-gatsby-package from 3.6.0 to 3.7.0 [`#397`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/397)
|
||||
- add additionalTrackers to set multiple trackers [`#403`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/403)
|
||||
- Bump babel-preset-gatsby-package from 3.5.0 to 3.6.0 [`#390`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/390)
|
||||
- Bump jest-environment-jsdom from 29.4.1 to 29.4.3 [`#395`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/395)
|
||||
- Bump jest from 29.4.1 to 29.4.3 [`#396`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/396)
|
||||
- Bump http-cache-semantics from 4.1.0 to 4.1.1 [`#389`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/389)
|
||||
- Bump eslint from 8.32.0 to 8.33.0 [`#387`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/387)
|
||||
- Bump babel-preset-gatsby-package from 3.4.0 to 3.5.0 [`#386`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/386)
|
||||
- Bump jest from 29.3.1 to 29.4.1 [`#385`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/385)
|
||||
- Bump jest-environment-jsdom from 29.3.1 to 29.4.1 [`#388`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/388)
|
||||
- Bump ua-parser-js from 0.7.32 to 0.7.33 [`#384`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/384)
|
||||
- Bump prettier from 2.8.2 to 2.8.3 [`#382`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/382)
|
||||
- Bump babel-preset-gatsby-package from 3.3.0 to 3.4.0 [`#383`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/383)
|
||||
- Bump engine.io and gatsby [`#381`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/381)
|
||||
- Bump jest from 29.3.0 to 29.3.1 [`#364`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/364)
|
||||
- Bump @babel/cli from 7.19.3 to 7.20.7 [`#380`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/380)
|
||||
- Bump eslint-config-prettier from 8.5.0 to 8.6.0 [`#379`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/379)
|
||||
- Bump release-it from 15.5.0 to 15.6.0 [`#377`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/377)
|
||||
- Bump eslint from 8.31.0 to 8.32.0 [`#378`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/378)
|
||||
- Bump jest-environment-jsdom from 29.3.0 to 29.3.1 [`#363`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/363)
|
||||
- Bump babel-preset-gatsby-package from 3.0.0 to 3.3.0 [`#372`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/372)
|
||||
- Bump prettier from 2.7.1 to 2.8.2 [`#376`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/376)
|
||||
- Bump eslint from 8.27.0 to 8.31.0 [`#374`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/374)
|
||||
- Bump json5 from 1.0.1 to 1.0.2 [`#375`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/375)
|
||||
- Bump decode-uri-component from 0.2.0 to 0.2.2 [`#370`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/370)
|
||||
- Bump loader-utils from 1.4.1 to 1.4.2 [`#365`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/365)
|
||||
- Release 0.15.0 [`6919fc6`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/6919fc6b1a8f9f91a8fc05a952d7ca7f318fca8d)
|
||||
|
||||
#### [v0.14.0](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.13.0...v0.14.0)
|
||||
|
||||
> 8 November 2022
|
||||
|
||||
- Bump loader-utils from 1.4.0 to 1.4.1 [`#362`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/362)
|
||||
- Bump release-it from 15.4.2 to 15.5.0 [`#361`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/361)
|
||||
- Bump eslint from 8.26.0 to 8.27.0 [`#360`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/360)
|
||||
- Bump ws from 7.4.5 to 7.4.6 [`#359`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/359)
|
||||
- Bump ansi-html and gatsby [`#358`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/358)
|
||||
- Bump node-forge and gatsby [`#357`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/357)
|
||||
- Bump parse-url and gatsby-telemetry [`#356`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/356)
|
||||
- Bump cross-fetch and graphql-config [`#355`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/355)
|
||||
- Bump vm2 from 3.9.9 to 3.9.11 [`#346`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/346)
|
||||
- Bump eslint from 8.23.1 to 8.26.0 [`#352`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/352)
|
||||
- Bump babel-preset-gatsby-package from 2.23.0 to 2.24.0 [`#348`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/348)
|
||||
- Bump @babel/cli from 7.18.10 to 7.19.3 [`#349`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/349)
|
||||
- Bump eslint from 8.23.0 to 8.23.1 [`#343`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/343)
|
||||
- Bump babel-preset-gatsby-package from 2.21.0 to 2.23.0 [`#344`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/344)
|
||||
- Bump release-it from 15.1.1 to 15.4.2 [`#342`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/342)
|
||||
- Bump @babel/cli from 7.18.6 to 7.18.10 [`#334`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/334)
|
||||
- Bump eslint from 8.22.0 to 8.23.0 [`#337`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/337)
|
||||
- Bump shell-quote from 1.7.2 to 1.7.3 [`#336`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/336)
|
||||
- Bump babel-preset-gatsby-package from 2.17.0 to 2.21.0 [`#333`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/333)
|
||||
- Bump eslint-plugin-prettier from 4.0.0 to 4.2.1 [`#323`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/323)
|
||||
- Bump prettier from 2.6.2 to 2.7.1 [`#321`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/321)
|
||||
- Bump file-type from 16.5.3 to 16.5.4 [`#328`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/328)
|
||||
- Bump eslint from 8.19.0 to 8.22.0 [`#332`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/332)
|
||||
- Bump terser from 5.12.1 to 5.14.2 [`#327`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/327)
|
||||
- Bump moment from 2.29.2 to 2.29.4 [`#320`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/320)
|
||||
- Bump eventsource from 1.1.0 to 1.1.1 [`#306`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/306)
|
||||
- Bump devcert from 1.2.0 to 1.2.1 [`#308`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/308)
|
||||
- Bump eslint from 8.15.0 to 8.19.0 [`#315`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/315)
|
||||
- Bump release-it from 14.14.1 to 15.1.1 [`#317`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/317)
|
||||
- Bump sharp from 0.30.3 to 0.30.6 [`#307`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/307)
|
||||
- Bump @babel/cli from 7.17.6 to 7.18.6 [`#316`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/316)
|
||||
- Bump parse-url from 6.0.0 to 6.0.2 [`#319`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/319)
|
||||
- Bump babel-preset-gatsby-package from 2.14.0 to 2.17.0 [`#314`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/314)
|
||||
- Bump eslint from 8.13.0 to 8.15.0 [`#303`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/303)
|
||||
- Bump babel-preset-gatsby-package from 2.11.0 to 2.14.0 [`#302`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/302)
|
||||
- Gatsby v5 support [`d02b3dd`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/d02b3dddbb11d6a05d2bf33495d022669f2d280d)
|
||||
- Release 0.14.0 [`469302a`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/469302ae6bb2f83095dfea192c2e7ac97190d1c3)
|
||||
|
||||
#### [v0.13.0](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.12.0...v0.13.0)
|
||||
|
||||
> 10 April 2022
|
||||
|
||||
- Bump prettier from 2.6.1 to 2.6.2 [`#291`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/291)
|
||||
- Bump moment from 2.29.1 to 2.29.2 [`#293`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/293)
|
||||
- Bump release-it from 14.13.1 to 14.14.0 [`#292`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/292)
|
||||
- Bump babel-preset-gatsby-package from 2.10.0 to 2.11.0 [`#290`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/290)
|
||||
- Bump eslint from 8.11.0 to 8.12.0 [`#289`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/289)
|
||||
- Bump prettier from 2.6.0 to 2.6.1 [`#288`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/288)
|
||||
- Bump minimist from 1.2.5 to 1.2.6 [`#287`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/287)
|
||||
- Bump babel-preset-gatsby-package from 2.9.0 to 2.10.0 [`#286`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/286)
|
||||
- Bump prettier from 2.5.1 to 2.6.0 [`#285`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/285)
|
||||
- Bump release-it from 14.12.5 to 14.13.1 [`#284`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/284)
|
||||
- Bump eslint from 8.10.0 to 8.11.0 [`#283`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/283)
|
||||
- default to Gatsby v4 peer dependency [`ac8dd7d`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/ac8dd7df43dea4ab674ce524f68356dcc6f9c473)
|
||||
- package updates [`3565e9a`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/3565e9aa9cce23aef293ae2a386d25cb9ad061b6)
|
||||
- Release 0.13.0 [`5bda1a1`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/5bda1a1777970a15b1859f94e66a83a042109b0c)
|
||||
|
||||
#### [v0.12.0](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.11.1...v0.12.0)
|
||||
|
||||
> 10 April 2022
|
||||
|
||||
- default to Gatsby v4 peer dependency [`5bdc911`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/5bdc911576e006f49bc40fee72905902dcfdfe7e)
|
||||
- package updates [`455d381`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/455d38166535b7d0b89acad32310970d41eef739)
|
||||
- Release 0.12.0 [`f9ad56c`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/f9ad56c0dbc900f173b950d01cde6105b3784a94)
|
||||
|
||||
#### [v0.11.1](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.11.0...v0.11.1)
|
||||
|
||||
> 11 March 2022
|
||||
|
||||
- Bump eslint-config-prettier from 8.4.0 to 8.5.0 [`#282`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/282)
|
||||
- Bump release-it from 14.12.4 to 14.12.5 [`#278`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/278)
|
||||
- Bump @babel/cli from 7.17.3 to 7.17.6 [`#277`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/277)
|
||||
- Bump eslint from 8.9.0 to 8.10.0 [`#279`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/279)
|
||||
- Bump url-parse from 1.5.7 to 1.5.10 [`#280`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/280)
|
||||
- Bump babel-preset-gatsby-package from 2.7.0 to 2.9.0 [`#281`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/281)
|
||||
- Bump eslint-config-prettier from 8.3.0 to 8.4.0 [`#274`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/274)
|
||||
- Bump @babel/cli from 7.17.0 to 7.17.3 [`#275`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/275)
|
||||
- Bump url-parse from 1.5.3 to 1.5.7 [`#273`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/273)
|
||||
- Bump follow-redirects from 1.14.1 to 1.14.8 [`#272`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/272)
|
||||
- Bump engine.io from 4.1.1 to 4.1.2 [`#271`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/271)
|
||||
- Bump babel-preset-gatsby-package from 2.6.0 to 2.7.0 [`#270`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/270)
|
||||
- Bump eslint from 8.8.0 to 8.9.0 [`#269`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/269)
|
||||
- Bump jest from 27.5.0 to 27.5.1 [`#268`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/268)
|
||||
- Bump @babel/cli from 7.16.8 to 7.17.0 [`#265`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/265)
|
||||
- Bump auto-changelog from 2.3.0 to 2.4.0 [`#266`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/266)
|
||||
- Bump jest from 27.4.7 to 27.5.0 [`#267`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/267)
|
||||
- Bump babel-preset-gatsby-package from 2.5.0 to 2.6.0 [`#263`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/263)
|
||||
- Bump nanoid from 3.1.30 to 3.2.0 [`#264`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/264)
|
||||
- Bump eslint from 8.7.0 to 8.8.0 [`#262`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/262)
|
||||
- Bump release-it from 14.12.3 to 14.12.4 [`#261`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/261)
|
||||
- Bump babel-preset-gatsby-package from 2.4.0 to 2.5.0 [`#257`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/257)
|
||||
- Bump release-it from 14.12.1 to 14.12.3 [`#258`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/258)
|
||||
- Bump eslint from 8.6.0 to 8.7.0 [`#259`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/259)
|
||||
- Bump @babel/cli from 7.16.7 to 7.16.8 [`#260`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/260)
|
||||
- Bump release-it from 14.11.8 to 14.12.1 [`#255`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/255)
|
||||
- Bump jest from 27.4.5 to 27.4.7 [`#256`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/256)
|
||||
- Bump @babel/cli from 7.16.0 to 7.16.7 [`#254`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/254)
|
||||
- Bump eslint from 8.5.0 to 8.6.0 [`#253`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/253)
|
||||
- Bump eslint from 8.4.1 to 8.5.0 [`#250`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/250)
|
||||
- Bump babel-preset-gatsby-package from 2.3.0 to 2.4.0 [`#252`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/252)
|
||||
- Bump eslint from 8.4.0 to 8.4.1 [`#248`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/248)
|
||||
- Bump eslint from 8.3.0 to 8.4.0 [`#247`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/247)
|
||||
- Bump babel-preset-gatsby-package from 2.2.0 to 2.3.0 [`#246`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/246)
|
||||
- Bump prettier from 2.5.0 to 2.5.1 [`#244`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/244)
|
||||
- package updates [`b6d51f7`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/b6d51f76cc6e54d9c002ddd44605fd191201d18b)
|
||||
- more package updates [`b4efe1d`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/b4efe1dfb0ee1793306316f8ed8da466957b19cc)
|
||||
- Create codeql-analysis.yml [`8bfa9d3`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/8bfa9d3b32fc0bc04ebc595b225cc3bbb3d7636a)
|
||||
|
||||
#### [v0.11.0](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.10.0...v0.11.0)
|
||||
|
||||
> 28 November 2021
|
||||
|
||||
- Bump release-it from 14.6.2 to 14.7.0 [`#192`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/192)
|
||||
- Bump babel-preset-gatsby-package from 1.5.0 to 1.6.0 [`#193`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/193)
|
||||
- Bump auto-changelog from 2.2.1 to 2.3.0 [`#191`](https://github.com/kremalicious/gatsby-plugin-matomo/pull/191)
|
||||
- support for Gatsby v4 [`#234`](https://github.com/kremalicious/gatsby-plugin-matomo/issues/234)
|
||||
- package updates [`842c343`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/842c34334339a8e63b8a5a2b5c40738a78d0f7a0)
|
||||
- Release 0.11.0 [`628dfb2`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/628dfb21ac11e320e33758bad829be166058fb18)
|
||||
- readme update [`b9f0d3d`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/b9f0d3d1dbf80d1aa7af40bde3dd1062701c979d)
|
||||
- skip coverage task for dependabot [`75cfaf4`](https://github.com/kremalicious/gatsby-plugin-matomo/commit/75cfaf49ec44d324dabf0244d3683eae7ffb505e)
|
||||
|
||||
#### [v0.10.0](https://github.com/kremalicious/gatsby-plugin-matomo/compare/v0.9.0...v0.10.0)
|
||||
|
||||
|
|
24
README.md
24
README.md
|
@ -69,19 +69,19 @@ _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. |
|
||||
| `enableJSErrorTracking` | (optional) Enable basic JavaScript error tracking and reporting in Matomo by setting to `true`. |
|
||||
|
||||
| `additionalTrackers` | (optional) An array of additional trackers to track on different Matomo servers. Additional trackers are objects with the keys `siteId` and `trackerUrl` containing the full URL to the Matomo PHP script. Defaults to `[]`. |
|
||||
```js
|
||||
plugins: [
|
||||
{
|
||||
|
@ -91,16 +91,22 @@ 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
|
||||
enableJSErrorTracking: true,
|
||||
additionalTrackers: [
|
||||
{
|
||||
siteId: 'ADDITIONAL_SITE_ID',
|
||||
trackerUrl: 'https://ADDITIONAL_MATOMO_URL.COM/matomo.php'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -146,4 +152,4 @@ Say thanks with BTC:
|
|||
`35UUssHexVK48jbiSgTxa4QihEoCqrwCTG`
|
||||
|
||||
Say thanks with ETH:
|
||||
`0x04354F554536DA108726829207958d3E277f0210`
|
||||
`krema.eth`
|
||||
|
|
File diff suppressed because it is too large
Load Diff
33
package.json
33
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "gatsby-plugin-matomo",
|
||||
"description": "Gatsby plugin to add Matomo (formerly Piwik) onto a site.",
|
||||
"version": "0.11.0",
|
||||
"version": "0.16.2",
|
||||
"author": "Matthias Kretschmann <m@kretschmann.io>",
|
||||
"scripts": {
|
||||
"build": "cross-env NODE_ENV=production babel src --out-dir . --ignore **/__tests__",
|
||||
|
@ -13,19 +13,19 @@
|
|||
"changelog": "auto-changelog -p",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.16.0",
|
||||
"auto-changelog": "^2.3.0",
|
||||
"babel-preset-gatsby-package": "^2.2.0",
|
||||
"@babel/cli": "^7.23.0",
|
||||
"@babel/core": "^7.23.0",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"babel-preset-gatsby-package": "^3.12.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.3.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"jest": "^26.6.3",
|
||||
"prettier": "^2.5.0",
|
||||
"react": ">=16.8",
|
||||
"release-it": "^14.11.8"
|
||||
"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": "^16.2.1"
|
||||
},
|
||||
"homepage": "https://kremalicious.com/gatsby-plugin-matomo",
|
||||
"keywords": [
|
||||
|
@ -39,12 +39,15 @@
|
|||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"peerDependencies": {
|
||||
"gatsby": "^2.0.0 || ^3.0.0 || ^4.0.0",
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
"gatsby": "^4.0.0 || ^5.0.0",
|
||||
"react": ">=17.0.0",
|
||||
"react-dom": ">=17.0.0"
|
||||
},
|
||||
"repository": "github:kremalicious/gatsby-plugin-matomo",
|
||||
"bugs": {
|
||||
"url": "https://github.com/kremalicious/gatsby-plugin-matomo/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,15 +4,17 @@
|
|||
|
||||
import { onRouteUpdate } from '../gatsby-browser'
|
||||
|
||||
jest.useFakeTimers()
|
||||
|
||||
describe('gatsby-plugin-matomo', () => {
|
||||
describe('gatsby-browser', () => {
|
||||
beforeEach(() => {
|
||||
jest.useFakeTimers()
|
||||
jest.spyOn(global, 'setTimeout')
|
||||
window._paq = { push: jest.fn() }
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks()
|
||||
jest.clearAllTimers()
|
||||
})
|
||||
|
||||
describe('onRouteUpdate', () => {
|
||||
|
@ -45,12 +47,12 @@ describe('gatsby-plugin-matomo', () => {
|
|||
process.env.NODE_ENV = env
|
||||
})
|
||||
|
||||
it('does not send page view when _paq is undefined', () => {
|
||||
delete window._paq
|
||||
onRouteUpdate({}, {})
|
||||
jest.runAllTimers()
|
||||
expect(setTimeout).not.toHaveBeenCalled()
|
||||
})
|
||||
// it('does not send page view when _paq is undefined', () => {
|
||||
// delete window._paq
|
||||
// onRouteUpdate({}, {})
|
||||
// // jest.runOnlyPendingTimers()
|
||||
// expect(setTimeout).not.toHaveBeenCalled()
|
||||
// })
|
||||
|
||||
it('sends page view', () => {
|
||||
onRouteUpdate({}, {})
|
||||
|
@ -60,7 +62,7 @@ describe('gatsby-plugin-matomo', () => {
|
|||
|
||||
it('uses setTimeout with a minimum delay of 32ms', () => {
|
||||
onRouteUpdate({}, {})
|
||||
jest.runAllTimers()
|
||||
jest.runOnlyPendingTimers()
|
||||
expect(setTimeout).toHaveBeenCalledWith(expect.any(Function), 32)
|
||||
expect(window._paq.push).toHaveBeenCalledTimes(5)
|
||||
})
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
import { onRenderBody } from '../gatsby-ssr'
|
||||
|
||||
describe('gatsby-plugin-google-analytics', () => {
|
||||
describe('gatsby-plugin-matomo', () => {
|
||||
describe('gatsby-ssr', () => {
|
||||
describe('onRenderBody', () => {
|
||||
describe('in non-production env', () => {
|
||||
|
@ -120,6 +120,20 @@ describe('gatsby-plugin-google-analytics', () => {
|
|||
const result = JSON.stringify(setPostBodyComponents.mock.calls[0][0])
|
||||
expect(result).not.toMatch(/navigator.doNotTrack/)
|
||||
})
|
||||
|
||||
it('sets additionalTrackers', () => {
|
||||
const { setPostBodyComponents } = setup({
|
||||
additionalTrackers: [
|
||||
{
|
||||
siteId: 'TEST_ADDITIONAL_SITE_ID',
|
||||
trackerUrl: 'TEST_ADDITIONAL_TRACKER_URL'
|
||||
}
|
||||
]
|
||||
})
|
||||
const result = JSON.stringify(setPostBodyComponents.mock.calls[0][0])
|
||||
expect(result).toMatch(/TEST_ADDITIONAL_SITE_ID/)
|
||||
expect(result).toMatch(/TEST_ADDITIONAL_TRACKER_URL/)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -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,
|
||||
|
@ -14,7 +14,8 @@ function buildTrackingCode(pluginOptions) {
|
|||
disableCookies,
|
||||
cookieDomain,
|
||||
enableJSErrorTracking,
|
||||
respectDnt = true
|
||||
respectDnt = true,
|
||||
additionalTrackers = []
|
||||
} = pluginOptions
|
||||
|
||||
const script = localScript ? localScript : `${matomoUrl}/${matomoJsScript}`
|
||||
|
@ -47,6 +48,13 @@ function buildTrackingCode(pluginOptions) {
|
|||
window._paq.push(['setTrackerUrl', '${matomoUrl}/${matomoPhpScript}']);
|
||||
window._paq.push(['setSiteId', '${siteId}']);
|
||||
window._paq.push(['enableHeartBeatTimer']);
|
||||
${additionalTrackers
|
||||
.map(
|
||||
(t) =>
|
||||
`window._paq.push(['addTracker', '${t.trackerUrl}', '${t.siteId}']);`
|
||||
)
|
||||
.join('\n')}
|
||||
|
||||
window.start = new Date();
|
||||
|
||||
(function() {
|
||||
|
|
Loading…
Reference in New Issue