Eric F.
1 decade ago
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.
Michael Zülsdorff
Replied 9 years ago
What's your problem Martin?
Martin Korn
Replied 9 years ago
You can make an update so you can enter the tracking code in the adminmenue and it is included on all pages
Sathish kumar
Replied 1 decade ago
nice work eric . your are started editing code . Great to see lot of people creating plugins
Eric F.
Replied 1 decade ago
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.
Arsalan Shah
Replied 1 decade ago
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 ossn_extend_view to:
ossn_extend_view('ossn/page/footer','stats/pages/stats');
Arsalan Shah
Replied 1 decade ago
You are doing great Eric, perhaps we can fork this component and create a google analytic.
Michael Zülsdorff
Replied 1 decade ago
Take a look at the bottom of
/ossn/themes/default/plugins/default/theme/page/page.php
It seems, that 'ossn_fetch_extend_views()' is the counterpart of 'ossn_extend_view()'
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 ossn_extend_view('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... :)
Eric F.
Replied 1 decade ago
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 :)
Michael Zülsdorff
Replied 1 decade ago
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.