Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 297
- Log:
Updated to AWStats 7.0.
- Author:
- rool
- Date:
- Fri Mar 18 13:33:29 +0000 2011
- Size:
- 18301 Bytes
- Properties:
- Property svn:executable is set
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> |
3 | <head> |
4 | <meta name="description" content="AWStats Documentation - Using the Extra Sections features"> |
5 | <meta name="keywords" content="awstats, awstat, extra, section, sections, feature, features, report, extrasection"> |
6 | <meta name="robots" content="index,follow"> |
7 | <meta name="title" content="AWStats Documentation - Using the Extra Sections features"> |
8 | <title>AWStats Documentation - Using the Extra Sections features</title> |
9 | <link rel="stylesheet" href="styles.css" type="text/css"> |
10 | <!-- $Revision: 1.33 $ - $Author: eldy $ - $Date: 2010/06/22 21:35:24 $ --> |
11 | </head> |
12 | |
13 | <body topmargin=10 leftmargin=5> |
14 | |
15 | |
16 | <table style="font: 10pt arial,helvetica,verdana" cellpadding=0 cellspacing=0 border=0 bgcolor=#FFFFFF width=100%> |
17 | |
18 | <!-- Large --> |
19 | <tr style="font: 10pt arial,helvetica,verdana"> |
20 | <td bgcolor=#9999cc align=center><a href="/"><img src="images/awstats_logo4.png" border=0></a></td> |
21 | <td bgcolor=#9999cc align=center> |
22 | <br> |
23 | <font style="font: 16pt arial,helvetica,sans-serif" color=#EEEEFF><b>AWStats logfile analyzer 7.0 Documentation</b></font><br> |
24 | <br> |
25 | </td> |
26 | <td bgcolor=#9999cc align=center> |
27 | |
28 | </td> |
29 | </tr> |
30 | |
31 | </table> |
32 | |
33 | |
34 | <br><br><H1 style="font: 26px arial,helvetica,sans-serif">Adding extra reports using the ExtraSection feature</H1> |
35 | |
36 | <br> |
37 | The AWStats ExtraSection features are powerfull setup options to allow you to add your own |
38 | report not provided by default with AWStats. You can use it to build special reports, like |
39 | number of sales for a particular product, marketing reports, counting for a particular |
40 | user or agent, etc...<br> |
41 | <br> |
42 | |
43 | <br><br> |
44 | <u><b>Explanation on how to add/edit an Extra report in your config file</b></u><br> |
45 | Take a look inside the AWStats config file to find the following part:<br> |
46 | <i> |
47 | #-----------------------------------------------------------------------------<br> |
48 | # EXTRA SECTIONS<br> |
49 | #-----------------------------------------------------------------------------<br> |
50 | <br> |
51 | </i> |
52 | Read all explanation in config file after this point, they will explain you |
53 | how to add an Extra report by adding an ExtraSection configuration in your config file,<br> |
54 | or just click <a href="#extraconfig">here</a> to jump to a copy of this explanation.<br> |
55 | <br> |
56 | Following examples are precious tutorials...<br> |
57 | |
58 | <a name="examples"> </a> |
59 | <br><br> |
60 | <u><b>Some examples of ExtraSection setup you can follow to build your own personalized reports:</b></u><br> |
61 | <br> |
62 | <li><a href="#productorders">Example 1: Tracking Product orders</a><br> |
63 | <li><a href="#bugzilla">Example 2: Tracking Bugzilla most frequently viewed bugs</a><br> |
64 | <li><a href="#awredir">Example 3: Tracking Exit clicks</a><br> |
65 | <li><a href="#aborted">Example 4: Tracking aborted download</a><br> |
66 | <li><a href="#domainaliases">Example 5: Tracking most requested domain aliases</a><br> |
67 | <li><a href="#level2dir">Example 6: List of top level 2 path under a directory /mydir</a><br> |
68 | <br> |
69 | And for more usage examples (like more precise Search Engine Optimization, referrals by domain, ...), |
70 | you can have a look at the very good page <a href="http://www.antezeta.com/awstats.html">Antezeta AWStats Enhancements and Extensions page</a>.<br> |
71 | <br> |
72 | |
73 | <br> |
74 | <br><a name="productorders"><H2 style="font: 18px arial,helvetica,sans-serif color: #606060"><u>Example 1: Tracking Product orders</u></H2></a> |
75 | Image your web site is an e-store that sells 80 different products. Each of them has an id. |
76 | Imagine each time, someone make an order for product 49, the order.cgi script or order2.cgi script |
77 | is called with, in URL query parameter, the id of the product, meanings that you get in your log |
78 | file a hit that looks like this:<br> |
79 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
80 | GET /cgi-bin/order.cgi?productid=49&session=A0B1C2 |
81 | </td></tr></table> |
82 | <br> |
83 | So this is how you need to setup your ExtraSection to track your product orders:<br> |
84 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
85 | ExtraSectionName1="Product orders" |
86 | <br>ExtraSectionCodeFilter1="200 304" |
87 | <br>ExtraSectionCondition1="URL,\/cgi\-bin\/order\.cgi|URL,\/cgi\-bin\/order2\.cgi" |
88 | <br>ExtraSectionFirstColumnTitle1="Product ID" |
89 | <br>ExtraSectionFirstColumnValues1="QUERY_STRING,productid=([^&]+)" |
90 | <br>ExtraSectionFirstColumnFormat1="%s" |
91 | <br>ExtraSectionStatTypes1=PL |
92 | <br>ExtraSectionAddAverageRow1=0 |
93 | <br>ExtraSectionAddSumRow1=1 |
94 | <br>MaxNbOfExtra1=100 |
95 | <br>MinHitExtra1=1 |
96 | </td></tr></table> |
97 | <br> |
98 | |
99 | |
100 | <br> |
101 | <br><a name="bugzilla"><H2 style="font: 18px arial,helvetica,sans-serif color: #606060"><u>Example 2: Tracking Bugzilla most frequently viewed bugs</u></H2></a> |
102 | This is an example on how to setup your ExtraSection:<br> |
103 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
104 | ExtraSectionName1="Bugzilla: Most frequently viewed bugs" |
105 | <br>ExtraSectionCodeFilter1="200 304" |
106 | <br>ExtraSectionCondition1="URL,\/bugzilla\/show_bug\.cgi" |
107 | <br>ExtraSectionFirstColumnTitle1="Bug ID" |
108 | <br>ExtraSectionFirstColumnValues1="QUERY_STRING,id=([^&]+)" |
109 | <br>ExtraSectionFirstColumnFormat1="<a href='/bugzilla/show_bug.cgi?id=%s' target=new>%s</a>" |
110 | <br>ExtraSectionStatTypes1=PL |
111 | <br>ExtraSectionAddAverageRow1=0 |
112 | <br>ExtraSectionAddSumRow1=1 |
113 | <br>MaxNbOfExtra1=500 |
114 | <br>MinHitExtra1=1 |
115 | </td></tr></table> |
116 | <br> |
117 | |
118 | |
119 | <br> |
120 | <br><a name="awredir"><H2 style="font: 18px arial,helvetica,sans-serif color: #606060"><u>Example 3: Tracking Exit clicks</u></H2></a> |
121 | AWStats shows you naturally the exit pages. However, you don't know where you visitor go |
122 | after exiting your site since clicking on a link that point to an external link will log |
123 | the viewed page on the external server and not on yours. |
124 | If you want to track this, you can, using the ExtraSection and the <b>awredir.pl</b> tool |
125 | (provided with AWStats).<br> |
126 | This tools must be used as a CGI wrapper. When called on 'A HREF' link, it returns to |
127 | browser a redirector to tell it to show the required page. |
128 | So, to use this script, you must replace HTML href tags that points to external web sites |
129 | onto your HTML pages from<br> |
130 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
131 | <a href="http://externalsite/pagelinked">Link</a> |
132 | </td></tr></table> |
133 | to<br> |
134 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
135 | <a href="http://yoursite/cgi-bin/awredir.pl?url=http://externalsite/pagelinked">Link</a> |
136 | </td></tr></table> |
137 | <br> |
138 | For your web visitor, there is no difference. However this allow you to track |
139 | clicks done on links onto your web pages that point to external web sites, |
140 | because an entry will be seen in your own server log like this record:<br> |
141 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
142 | 80.1.2.3 - - [01/Jan/2001:16:00:00 -0300] "GET /cgi-bin/awredir.pl?url=http://externalsite/pagelinked HTTP/1.1" 302 70476 "http://yoursite/pagewithlink.html" "FireBird/0.7"<br> |
143 | </td></tr></table> |
144 | <br> |
145 | Then, you can add in AWStats a chart to track all call to <i>awredir.pl</i> with |
146 | keys values taken from the "url=" parameter. You will get an independant chart, counting |
147 | all external pages viewed by your visitor after exiting your site.<br> |
148 | To have this chart, this is how you must setup your ExtraSection:<br> |
149 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
150 | ExtraSectionName1="Redirected Hit" |
151 | <br>ExtraSectionCodeFilter1="302" |
152 | <br>ExtraSectionCondition1="URL,\/cgi\-bin\/awredir\.pl" |
153 | <br>ExtraSectionFirstColumnTitle1="Url" |
154 | <br>ExtraSectionFirstColumnValues1="QUERY_STRING,url=([^&]+)" |
155 | <br>ExtraSectionStatTypes1=HL |
156 | <br>MaxNbOfExtra1=500 |
157 | <br>MinHitExtra1=1 |
158 | <br>ExtraSectionAddSumRow1=1 |
159 | </td></tr></table> |
160 | <br><br> |
161 | |
162 | |
163 | <br><a name="aborted"><H2 style="font: 18px arial,helvetica,sans-serif color: #606060"><u>Example 4: Tracking aborted download</u></H2></a> |
164 | Aborted downloads are reported in a log file by a 206 error, so this is how you need to setup your ExtraSection to add a chart for a such tracking:<br> |
165 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
166 | ExtraSectionName1="List of aborted download" |
167 | <br>ExtraSectionCodeFilter1="206" |
168 | <br>ExtraSectionCondition1="" |
169 | <br>ExtraSectionFirstColumnTitle1="URL" |
170 | <br>ExtraSectionFirstColumnValues1="URL,(.*)" |
171 | <br>ExtraSectionStatTypes1=PHB |
172 | <br>MaxNbOfExtra1=100 |
173 | <br>MinHitExtra1=1 |
174 | </td></tr></table> |
175 | <br><br> |
176 | |
177 | |
178 | <br><a name="domainaliases"><H2 style="font: 18px arial,helvetica,sans-serif color: #606060"><u>Example 5: Tracking most requested domain aliases</u></H2></a> |
179 | You have one website, but this web site has several domains named (for example the same site domain.com can be |
180 | reached with urls domain.com,www.domain.com,www.otherdomainname.com,www.againadomainname.org,...). |
181 | You want to know which domain alias is the most used.<br> |
182 | <br> |
183 | The first thing to do is to be sure the domain alias is recorded inside your log file. |
184 | If you use Apache, you must use a personalized Apache log file that contains the <i>%V</i> tag. |
185 | For example you can add in your Apache httpd.conf file a new Apache log format (This is |
186 | the Apache directive, not AWStats, to define an Apache log format that contains |
187 | the virtual domain):<br> |
188 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
189 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %V" combinedv |
190 | </td></tr></table> |
191 | Then check that your Apache CustomLog directives are defined like this:<br> |
192 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
193 | CustomLog pathtoyourlog/yourlog.log combinedv |
194 | </td></tr></table> |
195 | <br> |
196 | After restarting Apache, your log format should look like this<br> |
197 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
198 | 66.130.77.181 - - [09/Aug/2004:03:01:05 +0200] "GET /index.php HTTP/1.1" 200 1473 "-" "Firefox 1.0" www.otherdomainname.com<br> |
199 | </td></tr></table> |
200 | <br> |
201 | |
202 | When your web server log file contains the domain alias, you can now setup AWStats |
203 | to use it. For this use a personalised AWStats log format and use the <i>%extra1</i> tag at |
204 | the same position where the domain alias is. For example, for your combinedv Apache log format, |
205 | we will use:<br> |
206 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
207 | LogFormat="%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot %extra1" |
208 | </td></tr></table> |
209 | <br> |
210 | Every tag defined by name <i>extraZ</i> (Z is a number, you can use as many tags as you need) |
211 | can be used in any ExtraSection to extract the parameter. You can use the name <i>extraZ</i> as |
212 | a criteria in the <i>ExtraSectionFirstColumnValuesX</i> parameter (X is number of the extra report, you can |
213 | add as many report as you need) to tell AWStats to use value in log file at the place of |
214 | the tag, as the key for your report. For example:<br> |
215 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
216 | ExtraSectionName1="Domains aliases" |
217 | <br>ExtraSectionCodeFilter1="200 304" |
218 | <br>ExtraSectionCondition1="" |
219 | <br>ExtraSectionFirstColumnTitle1="Domain alias" |
220 | <br>ExtraSectionFirstColumnValues1="extra1,([^&]+)" |
221 | <br>ExtraSectionFirstColumnFormat1="%s" |
222 | <br>ExtraSectionStatTypes1=HL |
223 | <br>ExtraSectionAddAverageRow1=0 |
224 | <br>ExtraSectionAddSumRow1=1 |
225 | <br>MaxNbOfExtra1=20 |
226 | <br>MinHitExtra1=1 |
227 | </td></tr></table> |
228 | <br><br> |
229 | And result will be: |
230 | <style type="text/css"> |
231 | <!-- |
232 | .aws_bodyl { } |
233 | .aws_border { background-color: #CCCCDD; padding: 1px 1px 1px 1px; margin-top: 0; margin-bottom: 0; } |
234 | .aws_title { font: 13px verdana, arial, helvetica, sans-serif; font-weight: bold; background-color: #CCCCDD; text-align: center; margin-top: 0; margin-bottom: 0; padding: 1px 1px 1px 1px; color: #000000; } |
235 | .aws_blank { font: 13px verdana, arial, helvetica, sans-serif; background-color: #CCCCDD; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; } |
236 | .aws_data { |
237 | background-color: #FFFFFF; |
238 | border-top-width: 1px; |
239 | border-left-width: 0px; |
240 | border-right-width: 0px; |
241 | border-bottom-width: 0px; |
242 | } |
243 | .aws_formfield { font: 13px verdana, arial, helvetica; } |
244 | .aws_button { |
245 | font-family: arial,verdana,helvetica, sans-serif; |
246 | font-size: 12px; |
247 | border: 1px solid #ccd7e0; |
248 | background-image : url(/awstatsicons/other/button.gif); |
249 | } |
250 | th { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; padding: 1px 2px 1px 1px; font: 11px verdana, arial, helvetica, sans-serif; text-align:center; color: #000000; } |
251 | th.aws { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; padding: 1px 2px 1px 1px; font-size: 13px; font-weight: bold; } |
252 | td { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; font: 11px verdana, arial, helvetica, sans-serif; color: #000000; padding: 0px;} |
253 | td.awsm { border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; font: 11px verdana, arial, helvetica, sans-serif; text-align:left; color: #000000; padding: 0px; } |
254 | //--> |
255 | </style> |
256 | <a name="extra6"> </a><br /><table class="aws_border" border="0" cellpadding="2" cellspacing="0" width="100%"> |
257 | <tr><td class="aws_title" width="70%">Domains aliases</td><td class="aws_blank"> </td></tr> |
258 | <tr><td colspan="2"> |
259 | <table class="aws_data" border="1" bordercolor="#ECECEC" cellpadding="2" cellspacing="0" width="100%"> |
260 | <tr bgcolor="#ECECEC"><th>Domain alias</th><th align="center" bgcolor="#66F0FF" width="80">Hits</th><th width="120" align="center">Last visit</th></tr> |
261 | <tr><td class="aws">www.domain.com</td><td align="center">1757131</td><td align="center">08 August 2004 - 13:01</td></tr> |
262 | <tr><td class="aws">www.otherdomainname.com</td><td align="center">98518</td><td align="center">08 August 2004 - 12:54</td></tr> |
263 | <tr><td class="aws">domain.com</td><td align="center">19107</td><td align="center">08 August 2004 - 12:42</td></tr> |
264 | <tr><td class="aws">www.againadomainname.org</td><td align="center">7609</td><td align="center">08 August 2004 - 11:56</td></tr> |
265 | <tr><td class="aws"><b>Total</b></td><td align="center">1883986</td><td> </td></tr> |
266 | </table></td></tr></table><br /> |
267 | |
268 | |
269 | |
270 | |
271 | <br><a name="level2dir"><H2 style="font: 18px arial,helvetica,sans-serif color: #606060"><u>Example 6: List of top level 2 path under a directory /mydir</u></H2></a> |
272 | So this is how you need to setup your ExtraSection to add a chart for such a tracking:<br> |
273 | <table border=1 cellpadding=1 cellspacing=0 bgcolor=#F4F4F4 width="95%" class=CFAQ><tr class=CFAQ><td class=CFAQ> |
274 | ExtraSectionName1="List of top level 2 path under /mydir" |
275 | <br>ExtraSectionCodeFilter1="200 304" |
276 | <br>ExtraSectionCondition1="URL,^\/mydir\/.*" |
277 | <br>ExtraSectionFirstColumnTitle1="Directory name" |
278 | <br>ExtraSectionFirstColumnValues1="URL,^\/mydir\/([\w]+)\/" |
279 | <br>ExtraSectionStatTypes1=PHK |
280 | <br>MaxNbOfExtra1=50 |
281 | <br>MinHitExtra1=1 |
282 | </td></tr></table> |
283 | <br><br> |
284 | |
285 | |
286 | <br><br> |
287 | There is a lot of other possible use for Extra Sections ...<br> |
288 | <br> |
289 | |
290 | <br> |
291 | <br> |
292 | <br> |
293 | |
294 | |
295 | <a name="extraconfig"></a> |
296 | <br> |
297 | <u><b>The following explanation is same than the one found in AWStats config file:</b></u><br> |
298 | <br>#----------------------------------------------------------------------------- |
299 | <br># EXTRA SECTIONS |
300 | <br>#----------------------------------------------------------------------------- |
301 | <br># You can define your own charts, you choose here what are rows and columns |
302 | <br># keys. This feature is particularly usefull for marketing purpose, tracking |
303 | <br># products orders for example. |
304 | <br># For this, edit all parameters of Extra section. Each set of parameter is a |
305 | <br># different chart. For several charts, duplicate section changing the number. |
306 | <br># Note: Each Extra section reduces AWStats speed by 8%. |
307 | <br># |
308 | <br># WARNING: A wrong setup of Extra section might result in too large arrays |
309 | <br># that will consume all your memory, making AWStats unusable after several |
310 | <br># updates, so be sure to setup it correctly. |
311 | <br># In most cases, you don't need this feature. |
312 | <br># |
313 | <br># ExtraSectionNameX is title of your personalized chart. |
314 | <br># ExtraSectionCodeFilterX is list of codes the record code field must match. |
315 | <br># Put an empty string for no test on code. |
316 | <br># ExtraSectionConditionX are conditions you can use to count or not the hit, |
317 | <br># Use one of the field condition |
318 | <br># (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOSTINLOG,HOST,VHOST,extraX) |
319 | <br># and a regex to match, after a coma. Use "||" for "OR". |
320 | <br># ExtraSectionFirstColumnTitleX is the first column title of the chart. |
321 | <br># ExtraSectionFirstColumnValuesX is a string to tell AWStats which field to |
322 | <br># extract value from |
323 | <br># (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOSTINLOG,HOST,VHOST,extraX) |
324 | <br># and how to extract the value (using regex syntax). Each different value |
325 | <br># found will appear in first column of report on a different row. Be sure |
326 | <br># that list of different possible values will not grow indefinitely. |
327 | <br># ExtraSectionFirstColumnFormatX is the string used to write value. |
328 | <br># ExtraSectionStatTypesX are things you want to count. You can use standard |
329 | <br># code letters (P for pages,H for hits,B for bandwidth,L for last access). |
330 | <br># ExtraSectionAddAverageRowX add a row at bottom of chart with average values. |
331 | <br># ExtraSectionAddSumRowX add a row at bottom of chart with sum values. |
332 | <br># MaxNbOfExtraX is maximum number of rows shown in chart. |
333 | <br># MinHitExtraX is minimum number of hits required to be shown in chart. |
334 | |
335 | <br><br> |
336 | Warning: the ExtraSectionConditionX MUST use regex values since AWStats 6.0.<br> |
337 | ExtraSectionFirstColumnValuesX also need REGEX value for all AWStats versions.<br> |
338 | Return to <a href="#examples">examples</a> for examples on syntax use.<br> |
339 | <br> |
340 | |
341 | |
342 | |
343 | |
344 | <br> |
345 | <hr> |
346 | |
347 | <script language=javascript> |
348 | var date='$Date: 2010/06/22 21:35:24 $'; |
349 | document.writeln("Last revision: "+date); |
350 | </script> |
351 | |
352 | </body> |
353 | </html> |