| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
function pa_include_pages_stats( $current, $page_stats) { |
| 5 |
?> |
| 6 |
|
| 7 |
<div class="data_boxes"> |
| 8 |
<div class="data_boxes_title"><?php echo _e( 'What\'s happening when users come to your site.', 'wp-analytify'); ?> <div class="arrow_btn"></div></div> |
| 9 |
<div class="data_container"> |
| 10 |
<?php |
| 11 |
$exit_num = 0; |
| 12 |
$exit_path = ''; |
| 13 |
if (! empty( $page_stats["rows"]) ) { //print_r($page_stats["rows"]);?> |
| 14 |
|
| 15 |
<script type="text/javascript"> |
| 16 |
google.load("visualization", "1", { packages:["corechart"],'callback': drawChart} ); |
| 17 |
|
| 18 |
function drawChart() { |
| 19 |
var data = google.visualization.arrayToDataTable([ |
| 20 |
['Links', 'Page Views', 'Page exits'], |
| 21 |
<?php |
| 22 |
foreach ($page_stats["rows"] as $p_stats) { ?> |
| 23 |
['<?php echo $p_stats[0]; ?>', |
| 24 |
<?php echo $p_stats[2]; ?>, |
| 25 |
<?php echo $p_stats[3];?> |
| 26 |
], |
| 27 |
<?php } ?> |
| 28 |
]); |
| 29 |
var options = { |
| 30 |
hAxis: {titleTextStyle: {color: 'red'}} |
| 31 |
}; |
| 32 |
var formatter = new google.visualization.NumberFormat({fractionDigits: 0}); |
| 33 |
formatter.format( data, 1); |
| 34 |
formatter.format( data, 2); |
| 35 |
|
| 36 |
var chart = new google.visualization.ColumnChart(document.getElementById('pages_chart')); |
| 37 |
chart.draw(data, options); |
| 38 |
} |
| 39 |
</script> |
| 40 |
<div id="pages_chart" style="width: 960px; height: 400px; margin:0 auto;"></div> |
| 41 |
<div style="text-align:center; padding: 40px 0px;"><span class="large-count"><?php echo $current->wpa_number_format( $page_stats->totalsForAllResults['ga:exits'] ); ?></span> Total Exits</div> |
| 42 |
<?php |
| 43 |
|
| 44 |
foreach ($page_stats["rows"] as $p_stats) { |
| 45 |
$exit_num = $p_stats[1]; |
| 46 |
//$exit_path_title = $p_stats[0]; |
| 47 |
$exit_path = $p_stats[0]; |
| 48 |
break; |
| 49 |
} |
| 50 |
if( $exit_path == "/" ) { |
| 51 |
//$exit_path .= " -> Home"; |
| 52 |
} |
| 53 |
} |
| 54 |
?> |
| 55 |
</div> |
| 56 |
<div class="data_boxes_footer"> |
| 57 |
<span class="blk"> |
| 58 |
<span class="dot"></span> |
| 59 |
<span class="line"></span> |
| 60 |
</span> |
| 61 |
<span class="information-txt"><?php _e('Did you know that', 'wp-analytify')?> <b><?php echo $current->wpa_number_format( $exit_num ); ?></b> <?php _e(' people landed directly to your site at ', 'wp-analytify')?> <a href="<?php echo get_option('pt_webprofile_url') . $exit_path;?>" target="_blank"><?php echo $exit_path;?></a></span> |
| 62 |
</div> |
| 63 |
</div> |
| 64 |
<?php |
| 65 |
} |
| 66 |
?> |