-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.cfm
executable file
·230 lines (211 loc) · 9.4 KB
/
index.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!--- if logout requested or token expired, log out --->
<cfif (isDefined("URL.logout") and URL.logout EQ "true") OR (isDefined("session.ga_accessTokenExpiry") AND DateCompare(session.ga_accessTokenExpiry,Now(),"s") LT 0)>
<cfinvoke component="ga" method="logout" />
</cfif>
<cfif NOT isDefined("session.ga_accessToken") OR session.ga_accessToken CONTAINS "Authorization Failed">
<cflocation url="login.cfm" addtoken="no" />
</cfif>
<cfinvoke component="ga" method="init" />
<cfset daysInRange = DateDiff("d",session.startdate,session.enddate) + 1 />
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><cfoutput>#session.site#</cfoutput> Web Stats</title>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1/themes/blitzer/jquery-ui.css" />
<link rel="stylesheet" href="//jensbits.com/demos/bootstrap/css/bootstrap.min.css" />
<style>body {padding-top: 60px;}.float_right{float:right}</style>
<link rel="stylesheet" href="//jensbits.com/demos/bootstrap/css/bootstrap-responsive.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script src="js/util.js"></script>
</head>
<body>
<cfoutput>
<cf_header>
<div class="container">
<div class="hero-unit">
<h1>#session.site#</h1>
<h2>#DateFormat(session.startdate,"mmmm d, yyyy")# - #DateFormat(session.enddate,"mmmm d, yyyy")#</h2>
<p class="float_right"><a class="btn btn-danger" href="index.cfm?logout=true">Logout</a></p>
<p><button class="btn btn-primary" id="selectDateRange">Select New Date Range</button>
<button class="btn btn-info" id="selectSite">Select New Site</button></p>
</div>
<div class="row">
<div class="span4">
<!---output--->
<table class="table table-bordered table-striped">
<caption><h2>Pageviews</h2></caption>
<tr>
<th>Pageviews</th>
<td>#NumberFormat(session.visitsSnapshotArray[1].pageviews,",")#</td>
</tr>
<tr>
<th>Avg Per Day</th>
<td>#NumberFormat(session.visitsSnapshotArray[1].pageviews/daysInRange,",")#</td>
</tr>
<tr>
<th>Avg per Visit</th>
<td class="align-right">#NumberFormat(session.visitsSnapshotArray[1].pageviews/session.visitsSnapshotArray[1].visits,"0.00")#</td>
</tr>
</table>
</div>
<div class="span4">
<table class="table table-bordered table-striped">
<caption><h2>Visits</h2></caption>
<tr>
<th>Visits</th>
<td>#NumberFormat(session.visitsSnapshotArray[1].visits,",")#</td>
</tr>
<tr>
<th>Avg Per Day</th>
<td>#NumberFormat(session.visitsSnapshotArray[1].visits/daysInRange,",")#</td>
</tr>
<tr>
<th>Avg Visit Duration</th>
<td>#TimeFormat(CreateTime((session.visitsSnapshotArray[1].timeOnSite/session.visitsSnapshotArray[1].visits)/3600,(session.visitsSnapshotArray[1].timeOnSite/session.visitsSnapshotArray[1].visits)/60,(session.visitsSnapshotArray[1].timeOnSite/session.visitsSnapshotArray[1].visits) Mod 60), "HH:mm:ss")#</td>
</tr>
</table>
</div>
<div class="span4">
<table class="table table-bordered table-striped">
<caption><h2>Visitors</h2></caption>
<tr>
<th>Visitors</th>
<td>#NumberFormat(session.visitsSnapshotArray[1].visitors,",")#</td>
</tr>
<tr>
<th>Visits from New Visitors</th>
<td>#NumberFormat(session.visitorLoyaltyArray[1].visits,",")#</td>
</tr>
<tr>
<th>Visits from Returning Visitors</th>
<td>#NumberFormat(session.visitorLoyaltyArray[2].visits,",")#</td>
</tr>
<tr>
<th>Avg Visits per Visitor</th>
<td>#NumberFormat(session.visitsSnapshotArray[1].visits/session.visitsSnapshotArray[1].visitors,"0.00")#</td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="span9 offset3">
<h2>Visits Trend</h2>
<!--- style for webcharts --->
<cfsavecontent variable="style">
<?xml version="1.0" encoding="UTF-8"?>
<frameChart is3D="false">
<frame xDepth="12" yDepth="11"/>
<xAxis>
<labelStyle color="##333333"/>
</xAxis>
<yAxis scaleMin="0" scaleMax="500">
<labelStyle color="##333333"/>
</yAxis>
<legend allowSpan="true" equalCols="false" isVisible="false" halign="Right" isMultiline="true">
<decoration style="None"/>
</legend>
<decoration style="RoundShadow"/>
<paint palette="Pastel" isVertical="true" min="47" max="83"/>
<insets right="5"/>
</frameChart>
</cfsavecontent>
<cfchart yaxistitle="Number of Visits" chartwidth="600" style="#style#" format="jpg" tipstyle="none">
<cfchartseries type="bar" datalabelstyle="value">
<cfloop from="1" to="#ArrayLen(session.visitsChartArray)#" index="num">
<cfchartdata item="#MonthAsString(session.visitsChartArray[num].month)# #session.visitsChartArray[num].year#" value="#session.visitsChartArray[num].visits#" />
</cfloop>
</cfchartseries>
</cfchart>
</div>
</div>
<div class="row">
<div class="span9 offset3">
<cfsavecontent variable="style2">
<?xml version="1.0" encoding="UTF-8"?>
<frameChart is3D="false">
<frame xDepth="12" yDepth="11"/>
<xAxis>
<labelStyle color="##333333"/>
</xAxis>
<yAxis scaleMin="0" scaleMax="500">
<labelStyle color="##333333"/>
</yAxis>
<legend allowSpan="true" equalCols="false" isVisible="false" halign="Right" isMultiline="true">
<decoration style="None"/>
</legend>
<elements>
<column index="0">
<paint color="##0066CC"/>
</column>
<column index="1">
<paint color="##66CC00"/>
</column>
<column index="3">
<paint color="##CC0066"/>
</column>
<column index="4">
<paint color="##6600CC"/>
</column>
</elements>
<decoration style="RoundShadow"/>
<paint palette="Pastel" isVertical="true" min="47" max="83"/>
<insets right="5"/>
</frameChart>
</cfsavecontent>
<h2>Countries</h2>
<cfchart yaxistitle="Number of Visits" chartwidth="500" style="#style2#" format="jpg" tipstyle="none">
<cfchartseries type="bar" datalabelstyle="value">
<cfloop from="1" to="#ArrayLen(session.countryChartArray)#" index="num">
<cfchartdata item="#session.countryChartArray[num].country#" value="#session.countryChartArray[num].visits#" />
</cfloop>
</cfchartseries>
</cfchart>
</div>
</div>
<div class="row">
<div class="span12">
<table class="table table-bordered table-striped">
<caption><h2>Top Pages Summary</h2></caption>
<tr>
<th> </th>
<th>Title</th>
<th width="10%">Pageviews</th>
</tr>
<cfloop from="1" to="#ArrayLen(session.topPagesArray)#" index="num">
<tr>
<td>#num#</td>
<td>#HTMLEditFormat(session.topPagesArray[num].pageTitle)#</td>
<td class="align-right">#NumberFormat(session.topPagesArray[num].pageviews,",")#</td>
</tr>
</cfloop>
</table>
</div>
</div>
</div>
<div id="dialog" title="Select Date Range">
<div id="message"></div>
<form name="dateRange" id="dateRangeForm" action="index.cfm" method="post">
<label for="start date">Start Date</label>
<input id="startdate" readonly="readonly" type="text" /><input type="hidden" name="startdate" id="start_alternate" />
<label for="end date">End Date</label>
<input id="end date" readonly="readonly" type="text" /><input type="hidden" name="end date" id="end_alternate" />
</form>
</div>
<!---select new site modal form--->
<div id="site_dialog" title="Select Site">
<div id="message_site"></div>
<form name="siteSelect" id="siteSelectForm" action="index.cfm" method="post">
<label for="profileId">Select Site</label>
<select name="profileId" id="profileId">
<cfloop array="#session.profilesArray#" index="profile">
<option value="#profile.profileId#,#profile.title#">#profile.title#</option>
</cfloop>
</select>
</form>
</div>
</cfoutput>
<cf_footer>
</body>
</html>