commit
7bb322a34a
@ -0,0 +1,26 @@ |
||||
'use strict' |
||||
import { Plugin } from '@remixproject/engine' |
||||
|
||||
const _paq = window._paq = window._paq || [] |
||||
|
||||
const profile = { |
||||
name: 'matomo', |
||||
description: 'send analytics to Matomo', |
||||
methods: ['track'], |
||||
events: [''], |
||||
version: '1.0.0' |
||||
} |
||||
|
||||
const allowedPlugins = ['LearnEth', 'etherscan', 'vyper', 'circuit-compiler', 'doc-gen', 'doc-viewer', 'solhint', 'walletconnect', 'scriptRunner'] |
||||
|
||||
export class Matomo extends Plugin { |
||||
|
||||
constructor() { |
||||
super(profile) |
||||
} |
||||
|
||||
async track(data: string[]) { |
||||
if (!allowedPlugins.includes(this.currentRequest.from)) return |
||||
_paq.push(data) |
||||
} |
||||
} |
Loading…
Reference in new issue