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

add matomo plugin #4961

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/remix-ide/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import { xtermPlugin } from './app/plugins/electron/xtermPlugin'
import { ripgrepPlugin } from './app/plugins/electron/ripgrepPlugin'
import { compilerLoaderPlugin, compilerLoaderPluginDesktop } from './app/plugins/electron/compilerLoaderPlugin'
import { GitPlugin } from './app/plugins/git'
import { Matomo } from './app/plugins/matomo'

import {SolCoder} from './app/plugins/solcoderAI'

Expand Down Expand Up @@ -223,6 +224,9 @@ class AppComponent {
//---- git
const git = new GitPlugin()

//---- matomo
const matomo = new Matomo()

//---------------- Solidity UML Generator -------------------------
const solidityumlgen = new SolidityUmlGen(appManager)

Expand Down Expand Up @@ -357,7 +361,8 @@ class AppComponent {
templates,
solcoder,
git,
pluginStateLogger
pluginStateLogger,
matomo
])

//---- fs plugin
Expand Down Expand Up @@ -476,7 +481,8 @@ class AppComponent {
'network',
'web3Provider',
'offsetToLineColumnConverter',
'pluginStateLogger'
'pluginStateLogger',
'matomo'
])
await this.appManager.activatePlugin(['mainPanel', 'menuicons', 'tabs'])
await this.appManager.activatePlugin(['statusBar'])
Expand Down
26 changes: 26 additions & 0 deletions apps/remix-ide/src/app/plugins/matomo.ts
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)
}
}
3 changes: 2 additions & 1 deletion apps/remix-ide/src/remixAppManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ let requiredModules = [ // services + layout views + system views
'dgit',
'pinnedPanel',
'pluginStateLogger',
'remixGuide'
'remixGuide',
'matomo'
]


Expand Down
Loading