How can I show a Hit/Visits Counter on my page which uses Piwik for analytics

╄→гoц情女王★ 提交于 2019-12-21 05:00:32

问题


I want to show the Visits for the current day on a homepage. That page is tracked with Piwik.

How to use the API with PHP to get the (unique) visits and hits for today so that I can show them somewhere on the page


回答1:


$result = file_get_contents("http://mysite.com/piwik/?module=API&method=VisitsSummary.getUniqueVisitors&idSite=1&period=day&date=today&format=php");
echo unserialize($result);



回答2:


Maybe it's later answer but...

A few days ago I wrote a new plugin for Piwik which displays total visit and views on image for custom site for custom date range.

For more information please visit http://киноархив.com/en/others/notes-on-html-jquery-php-mysql/10-piwik-graphical-counter.html

and post any information about bugs here https://github.com/Globulopolis/Counter/issues



来源:https://stackoverflow.com/questions/3786461/how-can-i-show-a-hit-visits-counter-on-my-page-which-uses-piwik-for-analytics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!