Let Viewers see statistics


#1

For some reason, I can’t let users view the statistics.

I login and click Settings -> Users -> and I allow anonymous to view

Am I doing something wrong?


#2

I have the latest version too.


#3

The requested website idSite is not found in the request, or is invalid. Please check that you are logged in Piwik and have permission to access the specified website.

That’s the error

ppmegahelpsite.org is the wbesite - near the bottom of the page.

I haven’t used any plugins.


#4

If you want put statistical data from Piwik in you site, maybe this help.

Widgets -> Visits sumary -> Last visits graph -> Export this dataset in other formats -> XML

http://www.site.com/piwik/index.php?module=API&method=VisitsSummary.get&format=XML&idSite=5&period=day&date=2011-10&filter_limit=100

Change the tag:
date=2011-10-15,2011-11-13

to a spefic period of time, in this case 2011-10, the full moth.
date=2011-10

Now with PHP and Javascript:

I use: Basic line | Highcharts

The code:

<?php $mes_actual = date('Y-m', strtotime('now')); $mes_pasado = date('Y-m', strtotime('-1 month')); $mes_2menos = date('Y-m', strtotime('-2 month')); $mes_3menos = date('Y-m', strtotime('-3 month')); ?> var chart; jQuery(document).ready(function() { chart = new Highcharts.Chart({ chart: { renderTo: 'sitio_visitas', defaultSeriesType: 'line' }, title: { text: '' }, subtitle: { text: '' }, xAxis: { categories: [<?php echo "'$mes_3menos', '$mes_2menos', '$mes_pasado', '$mes_actual'"; ?>] }, yAxis: { title: { text: '' } }, tooltip: { enabled: false, formatter: function() { return ''+ this.series.name +'
'+ this.x +': '+ this.y +'°C'; } }, plotOptions: { line: { dataLabels: { enabled: true }, enableMouseTracking: false } }, series: [{ name: 'Visitas totales', data: [<?

$objDOM = new DOMDocument();
$objDOM->load(“yoursite.com”); //make sure path is correct

$result = $objDOM->getElementsByTagName(“result”);

foreach( $result as $value )
{
$nb_visits = $value->getElementsByTagName(“nb_visits”);
$nb_visits = $nb_visits->item(0)->nodeValue;
echo "$nb_visits, ";
}

$objDOM = new DOMDocument();
$objDOM->load(“yoursite.com”); //make sure path is correct

$result = $objDOM->getElementsByTagName(“result”);

foreach( $result as $value )
{
$nb_visits = $value->getElementsByTagName(“nb_visits”);
$nb_visits = $nb_visits->item(0)->nodeValue;
echo "$nb_visits, ";
}

$objDOM = new DOMDocument();
$objDOM->load(“yoursite.com”); //make sure path is correct

$result = $objDOM->getElementsByTagName(“result”);

foreach( $result as $value )
{
$nb_visits = $value->getElementsByTagName(“nb_visits”);
$nb_visits = $nb_visits->item(0)->nodeValue;
echo "$nb_visits, ";
}

$objDOM = new DOMDocument();
$objDOM->load(“yoursite.com”); //make sure path is correct

$result = $objDOM->getElementsByTagName(“result”);

foreach( $result as $value )
{
$nb_visits = $value->getElementsByTagName(“nb_visits”);
$nb_visits = $nb_visits->item(0)->nodeValue;
echo “$nb_visits”;
}

?>]
}, {
name: ‘Visitas unicas’,
data: [<?

$objDOM = new DOMDocument();
$objDOM->load(“yoursite.com”); //make sure path is correct

$result = $objDOM->getElementsByTagName(“result”);

foreach( $result as $value )
{
$nb_uniq_visitors = $value->getElementsByTagName(“nb_uniq_visitors”);
$nb_uniq_visitors = $nb_uniq_visitors->item(0)->nodeValue;
echo "$nb_uniq_visitors, ";
}

$objDOM = new DOMDocument();
$objDOM->load(“yoursite.com”); //make sure path is correct

$result = $objDOM->getElementsByTagName(“result”);

foreach( $result as $value )
{
$nb_uniq_visitors = $value->getElementsByTagName(“nb_uniq_visitors”);
$nb_uniq_visitors = $nb_uniq_visitors->item(0)->nodeValue;
echo "$nb_uniq_visitors, ";
}

$objDOM = new DOMDocument();
$objDOM->load(“yoursite.com”); //make sure path is correct

$result = $objDOM->getElementsByTagName(“result”);

foreach( $result as $value )
{
$nb_uniq_visitors = $value->getElementsByTagName(“nb_uniq_visitors”);
$nb_uniq_visitors = $nb_uniq_visitors->item(0)->nodeValue;
echo "$nb_uniq_visitors, ";
}

$objDOM = new DOMDocument();
$objDOM->load(“yoursite.com”); //make sure path is correct

$result = $objDOM->getElementsByTagName(“result”);

foreach( $result as $value )
{
$nb_uniq_visitors = $value->getElementsByTagName(“nb_uniq_visitors”);
$nb_uniq_visitors = $nb_uniq_visitors->item(0)->nodeValue;
echo “$nb_uniq_visitors”;
}

?>]
}]
});

	});
</script>
<div id="sitio_visitas" class="highcharts-container" style="height:300px; margin: 0px; clear:both; width: 400px">
</div>



<div align="right" style="font-size:10px"><a href="http://www.highcharts.com" target="_blank"><font color="#909090">Highcharts.com</font></a></div>
```