Hi @Karmalakas ,
Generally speaking, it is allowed to gather analytics data in your plugins (many developers, including myself in some of my plugins) do this.
Typically, it isn’t as easy as just integrating a Google Analytics script into a website, since the lifecycle of a plugin is different (you don’t really want to count “page visits”.
Depending on what analytics provider (Google Analytics/ Matomo/ …), you’ll need to (a) include a library to “ping” (for lack of a better term) the provider and (b) call the functions from this library whenever an event you’d like to track occurs.
Apart from the technical side, the “judicial” side can be more challenging:
Since you’re probably distributing your plugins to both businesses and consumers all around the world, compliance with the various privacy laws can be more challenging than the technical side of things (but also the technical side of things, like gathering consent from your users, plays into this). So I suggest looking out for that when implementing such a solution (unless you like to “live dangerously”). Personally, I (to make it easier for me) created my own analytics solution for plugins to make it gather as few bits of data as possible (to make that judicial side of things easier on myself).
Therefore, overall, it’s definitely possible and “allowed” to gather analytics yourself, but at least if you want to be safe from a judicial point of view, it can definitely be challenging to implement this in a “clean” way.
I hope this helps,