Approach needed to preprocess fetched HTTP requests within plugin before insert


#1

Hi,

I am currently trying to build a Piwik plugin to analyze all HTTP request sent to our target application to find out more about the user behavior.
The main steps are:

[ol]
[li] Capture requests - I’m doing this with our JavaScript framework using an I/O filter.
[/li][li] Send data to Piwik plugin
[/li][li] Parse data with eighter the plugin itself or e.g. a Java web service
[/li][li] Load data to Piwik database
[/li][/ol]

I’m not actually clear about how it should be done properly.
First I was trying to use the ‘trackEvent’ event, but I am not sure which hook could possibly intercept that event.
My second idea was to use custom variables, but that would be impossible due to the amount of parameters (initial values, filters used by user, input filled into several fields etc. etc.).
The third idea was to send an request directly to the plugin like url/module=ModuleName&method=Module.processBackendRequest…
This -in my opinion doesn’t work for the class extending Piwik\Plugin, but only for the Controller / API?.

Would you have any suggestions?
I would try to write that plugin generically enough to contribute it to Piwik [If it is even possible to implement such a plugin (I’m confident I would be able with your initial help)].
Thank you very much in advance.


#2

Maybe you would be better off storing the data bout all the custom events in HAR format and using existing code displaying har traces?
As long as it is not field values but just exection times, it should do…