Plugins are small scripts, which performs certain functions within a page. As an example take nfrPiwik which writes the piwik tracking code at the end of the page just before the closing body tag.
For statistic/site analysis there are a lot of programs or extensions available.
One of the best is Google Analytics. But with this program I do have my pain, because many of the observed data is stored and commercialized by Google.
The better way for me is a program which analyzes the same information but the data raised is on a server I know - mine.
Matomo is doing this job. Matomo is an Open source project with an open API.
You must install Matomo on a server first, best you take your own. During installation process piwik generates a tracking code which should be inserted at the end in your main page. If you are using Joomla! then this is the index.php of the current template. If you are using more then one template in your site, then you have to copy this tracking code into all of the index.php's.
For the CMS Joomla! I have developed a plugin which is doing this copying for. You just insert this tracking code in the parameter list of the plugin and the plugin writes this code in every index.php you might use.
You will find this plugin under downloads - plugins. Remember to insert the tracking code in there and to activate this plugin.
If you still have any questions about this plugin please send an eMail to support(at)nfrtest.de