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

Matomo plugin? #187

Closed
mhf-ir opened this issue Jul 18, 2021 · 2 comments
Closed

Matomo plugin? #187

mhf-ir opened this issue Jul 18, 2021 · 2 comments

Comments

@mhf-ir
Copy link

mhf-ir commented Jul 18, 2021

Any plan to support Matomo? https://matomo.org/

@DavidWells
Copy link
Owner

Hello there!

I won't have time to build this integration myself but you are more than welcome to 😃

See https://getanalytics.io/plugins/writing-plugins/#1-provider-plugins for writing a plugin.

Essentially, you will want to map the page, track methods to the Matomo JS calls

export default function pluginExample(userConfig) {
  return {
    /* All plugins require a name */
    name: 'matomo-plugin',
    /* Everything else below this is optional depending on your plugin requirements */
    config: {
      whatEver: userConfig.whatEver,
      elseYouNeed: userConfig.elseYouNeed
    },
    initialize: ({ config }) => {
      // load matomo script to page
    },
    page: ({ payload }) => {
      // call matomo specific page tracking
    },
    track: ({ payload }) => {
      // call matomo event tracking
    },
    loaded: () => {
      // return boolean so analytics knows when it can send data to third party
      return !!window.myPluginLoaded
    }
  }
}

@DavidWells DavidWells mentioned this issue Jul 20, 2021
23 tasks
@DavidWells
Copy link
Owner

Moving over to this thread #153

Let me know if you have any questions on creating plugins

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

No branches or pull requests

2 participants