refactor: replace GA with GA4

This commit is contained in:
lilong.129
2023-07-20 23:08:51 +08:00
parent 503b3fd38f
commit 17b6d95b3b
8 changed files with 48 additions and 51 deletions

View File

@@ -90,15 +90,14 @@ func initPlugin(path, venv string, logOn bool) (plugin funplugin.IPlugin, err er
pluginMap.Store(pluginPath, plugin)
// report event for initializing plugin
event := sdk.EventTracking{
Category: "InitPlugin",
Action: fmt.Sprintf("Init %s plugin", plugin.Type()),
Value: 0, // success
params := map[string]interface{}{
"type": plugin.Type(),
"result": "success",
}
if err != nil {
event.Value = 1 // failed
params["result"] = "failed"
}
go sdk.SendEvent(event)
go sdk.SendGA4Event("init_plugin", params)
return
}