Add analytics
[bus.git] / busui / owa / modules / base / templates / report_visitors.tpl
maxious 1 <div class="owa_reportSectionContent">
2 <div id="visitor-trend" style="height:125px;width:auto;"></div>
3 <div id="trend-metrics"></div>
4
5 <script>
6 //OWA.setSetting('debug', true);
7 var aurl = '<?php echo $this->makeApiLink(array('do' => 'getResultSet',
8 'metrics' => 'uniqueVisitors,newVisitors,repeatVisitors,visits,visitDuration',
9 'dimensions' => 'date',
10 'sort' => 'date',
11 'format' => 'json'), true);?>';
12
13 OWA.items.visitortrend = new OWA.resultSetExplorer('visitor-trend');
14 OWA.items.visitortrend.asyncQueue.push(['makeAreaChart', [{x:'date',y:'uniqueVisitors'}], 'visitor-trend']);
15 OWA.items.visitortrend.asyncQueue.push(['makeMetricBoxes' , 'trend-metrics']);
16 OWA.items.visitortrend.asyncQueue.push(['renderTemplate','#visitors-headline-template', {data: OWA.items.visitortrend}, 'replace', 'visitors-headline']);
17 OWA.items.visitortrend.options.metricBoxes.width = '135px';
18 OWA.items.visitortrend.load(aurl);
19
20 </script>
21 <div class="clear"></div>
22 <div class="owa_reportHeadline" id="visitors-headline"></div>
23
24 </div>
25
26
27 <table width="100%">
28 <TR>
29 <td>
30 <div class="owa_reportSectionContent" style="width:500px;">
31 <div class="owa_reportSectionHeader">Latest Visits</div>
32 <?php include('report_latest_visits.tpl')?>
33 <?php echo $this->makePaginationFromResultSet($visits, array('do' => 'base.reportVisitors'), true);?>
34 </div>
35 </td>
36 <TD width="50%" valign="top">
37 <div class="owa_reportSectionContent">
38 <div class="section_header inline_h2">Visitor Reports</div>
39 <P>
40 <span class="inline_h3"><a href="<?php echo $this->makeLink(array('do' => 'base.reportVisitorsLoyalty'));?>">Visitor Loyalty</a></span> - See how long ago your visitors first came to your web site.
41 </P>
42 <P>
43 <span class="inline_h3"><a href="<?php echo $this->makeLink(array('do' => 'base.reportVisitsGeolocation'));?>">Geo-location</a></span> - See which parts of the world your visitors are coming from.
44 </P>
45 <P>
46 <span class="inline_h3"><a href="<?php echo $this->makeLink(array('do' => 'base.reportHosts'));?>">Domains</a></span> - See which Networks or Internet hosts your visitors are coming from.
47 </P>
48 </div>
49
50
51 <div class="owa_reportSectionContent">
52 <div class="owa_reportSectionHeader">Browser Types</div>
53 <div id="top-browsers"></div>
54 <script>
55
56 var bturl = '<?php echo $this->makeApiLink(array('do' => 'getResultSet',
57 'metrics' => 'visits',
58 'dimensions' => 'browserType',
59 'sort' => 'visits-',
60 'resultsPerPage' => 10,
61 'format' => 'json'
62 ),true);?>';
63
64 OWA.items.browsertypes = new OWA.resultSetExplorer('top-browsers');
65 OWA.items.browsertypes.addLinkToColumn('browserType', '<?php echo $this->makeLink(array('do' => 'base.reportBrowserDetail', 'browserType' => '%s'),true); ?>', ['browserType']);
66 OWA.items.browsertypes.asyncQueue.push(['refreshGrid']);
67 OWA.items.browsertypes.load(bturl);
68
69 </script>
70 </div>
71
72 <div class="owa_reportSectionContent">
73 <div class="owa_reportSectionHeader">Most Frequent Visitors</div>
74 <div id="top-visitors"></div>
75 <script>
76
77 var tvurl = '<?php echo $this->makeApiLink(array('do' => 'getResultSet',
78 'metrics' => 'visits,pageViews',
79 'dimensions' => 'visitorId',
80 'sort' => 'visits-',
81 'resultsPerPage' => 10,
82 'format' => 'json'
83 ),true);?>';
84
85 OWA.items.topvisitors = new OWA.resultSetExplorer('top-visitors');
86 OWA.items.topvisitors.addLinkToColumn('visitorId', '<?php echo $this->makeLink(array('do' => 'base.reportVisitor', 'visitorId' => '%s')); ?>', ['visitorId']);
87 OWA.items.topvisitors.asyncQueue.push(['refreshGrid']);
88 OWA.items.topvisitors.load(tvurl);
89
90 </script>
91 </div>
92
93 </TD>
94 </TR>
95 </table>
96
97 <?php require_once('js_report_templates.php');?>
98
99 <script type="text/x-jqote-template" id="visitors-headline-template">
100 <![CDATA[
101 There were <*= this.data.resultSet.aggregates.uniqueVisitors.formatted_value *> <* if (this.data.resultSet.aggregates.uniqueVisitors.value > 1) {this.label = 'visitors';} else {this.label = 'visitor';} *> <*= this.label *> to this web site.
102 ]]>
103 </script>