-
Notifications
You must be signed in to change notification settings - Fork 952
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88e16ab
commit 49a781d
Showing
3 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters