Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tracking option to extend matomo config #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dumconstantin
Copy link

@dumconstantin dumconstantin commented Jul 13, 2022

Added a way to extend the plugin configuration so that other Matomo options can be used.
Also, removed 'enableHeartBeatTimer and setRequestMethod from the default configs - these can be added if needed.
See README.md changes for usage.

@karser
Copy link
Owner

karser commented Jul 14, 2022

Thanks for the PR. Can you please document an option equivalent to _paq.push(['setRequestMethod', 'POST'])?

@dumconstantin
Copy link
Author

Sure, I've added it to the readme.

@karser
Copy link
Owner

karser commented Aug 1, 2022

Sorry for the delay, just got to it.
The behavior is not the same, something doesn't work.

Original behavior, you can check it here:
image

This PR - the behavior is not the same, which leads Matomo to get blocked by brave or adblock
image
I use the following config:

matomo: {
  matomoUrl: 'https://vega.dev.trackmage.com/',
  siteId: '2',
  phpLoader: 'mm.php',
  jsLoader: 'mjs.php',
  tracking: [
    ['enableHeartBeatTimer'],
    ['setRequestMethod', 'POST']
  ]
},

Comment on lines 50 to 51
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
Copy link

@Dr-Electron Dr-Electron Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, is this PR still in development? I would need this change too.
Also not sure why this shouldn't work or be different from the current state. Maybe the order of the element creates the problem? My guide mentioned that my option should be added at the beginning for example.

So maybe we could make the following changes and add everything to the config? That way everyone can specify the order of elements like this in the config

matomo: {
  matomoUrl: 'https://vega.dev.trackmage.com/',
  siteId: '2',
  phpLoader: 'mm.php',
  jsLoader: 'mjs.php',
  tracking: [
    ['setRequestMethod', 'POST'],
    ['trackPageView'],
    ['enableLinkTracking']
    ['enableHeartBeatTimer'],
  ]
},
Suggested change
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants