Add piwik to OSSN
Component to get piwik stats from your OSSN (https://github.com/opensource-socialnetwork/opensource-socialnetwork) site.
You need to get a Piwik (http://piwik.org/) site working.
Upload compoents and enble it. You can configure from the admin panel of OSSN, at letf topbar select configure and Piwik. Just put your domain name (OSSN) ex: toto.com and your site Id than you have in Piwik for your OSSN site.
What's your problem Martin?
- You CAN configure this component from the Admin->Configure menu
- And the code IS inserted on every page
You can make an update so you can enter the tracking code in the adminmenue and it is included on all pages
nice work eric . your are started editing code . Great to see lot of people creating plugins
Hi,
I've make test on js load, even if we put it on footer, it won't change much the DOMContentLoading time.
It'll appear at the end of source code but that's all.
Best will be to get a js file for the tracking code and loading it after the page loaded with script like I do for the jquery-ui.js
But I don't know how to write the 2 value in the js file and still searching :).
I don't know google analytics but may just need to change the code.
ossn_extend_view('<name of view>', 'a path of file || function name');
To move the script in bottom of page you just need to change a line that ossnextendview to:
ossn_extend_view('ossn/page/footer','stats/pages/stats');
You are doing great Eric, perhaps we can fork this component and create a google analytic.
Take a look at the bottom of
/ossn/themes/default/plugins/default/theme/page/page.php
It seems, that 'ossnfetchextend_views()' is the counterpart of 'ossnextendview()'
Kind of a hook to insert additional stuff.... And since this is the bottom most hook we can find, simply change your PIWIK inserting point like ossnextendview('ossn/page/footer', 'stats/pages/stats');
Yeah, I'm convinced we would have a lot more modules if we had some documentation we could refer to. Right now, programming often feels like just guessing... :)
Hi Micha,
I know much that :) Problem is than I don't know how to put it at the end of body :).
Better will be after the load page as I make for the jquery-ui.js
My knowledge is poor, I'm just try to understand things & compare to built from a base :)
Thanks Eric!
Just one note: To my experience it's better to insert that Piwik stuff at the bottom of body the section. Placing it in the head section can delay page rendering with slower servers.