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

Plugin request: Umami #149

Closed
mgorsk1 opened this issue Feb 25, 2021 · 2 comments
Closed

Plugin request: Umami #149

mgorsk1 opened this issue Feb 25, 2021 · 2 comments

Comments

@mgorsk1
Copy link

mgorsk1 commented Feb 25, 2021

Umami is super simple and popular open-source project for analytics. It provides API to send custom data to it and could potentially be integrated with analytics.

https://github.com/mikecao/umami

@DavidWells
Copy link
Owner

DavidWells commented Feb 28, 2021

Umami looks pretty cool.

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 umami JS calls

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

@DavidWells
Copy link
Owner

A consolidated issue has been created at #153 for plugin requests.

Feel free to comment/reopen this thread if you have begun active development on this plugin.

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

No branches or pull requests

2 participants