Best practice


(Fellmer Lloyd) #1

Hi all

We want to track some custom data on every page hit.
So I have written a Plugin which does that, but I’m not sure if I followed the “correct Piwik approach”.

I’ve created an additional table in our Piwik DB. This table uses the idlink_va value as primary key (thus, we’re able to JOIN with the other information).
After that, I’ve written our plugin using the hook ‘Tracker.Action.record’. This method executes a Piwik_Query to insert the custom data into our table.

Is this the correct approach? Or should we rewrite something (e.g. we aren’t using any archiving hooks).

Regards,
Fellmer


(Matthieu Aubry) #2

It sounds like you’re doing the right thing to record additional page view data.
If you want to report on this data, you would also need to archive it.


(Anita) #3

Hi

I also want to track some custom data on every page hit.

But in my plugin Tracker.Action.record is not getting triggered. Can u share the sample code here.

Regards
Anita