Difference between revisions of "How to configure ContentMetrics"

From EtherWiki
Jump to: navigation, search
 
(Configuring the source web site)
Line 28: Line 28:
 
* <code>'''%REGION-ID%'''</code> - A unique value within the registered <code>'''%HOST-NAME%'''</code>
 
* <code>'''%REGION-ID%'''</code> - A unique value within the registered <code>'''%HOST-NAME%'''</code>
 
* <code>'''%ACTIONS%'''</code> - A [http://en.wikipedia.org/wiki/Mask_(computing) bit mask] of allowable actions for this view of the reigon:
 
* <code>'''%ACTIONS%'''</code> - A [http://en.wikipedia.org/wiki/Mask_(computing) bit mask] of allowable actions for this view of the reigon:
** 100 - Record each visit
+
 
** 010 - Allow visitors to up vote
+
<table class="wikitable">
** 001 - Allow visitors to down vote
+
<tr>
 +
<th>Value (position)</th><th>Description</th>
 +
</tr>
 +
<tr>
 +
<td>100 (1)</td><td>Record each visit</td>
 +
</tr>
 +
<tr>
 +
<td>010 (2)</td><td>Allow visitors to up vote</td>
 +
</tr>
 +
<tr>
 +
<td>001 (3)</td><td>Allow visitors to down vote</td>
 +
</tr>
 +
</table>
 +
 
 
* <code>'''%METRICS%'''</code> - A bit mask of what recorded metrics should be displayed:
 
* <code>'''%METRICS%'''</code> - A bit mask of what recorded metrics should be displayed:
 +
 +
<table class="wikitable">
 +
<tr>
 +
<th>Value (position)</th><th>Description</th>
 +
</tr>
 +
<tr>
 +
<td>1000000 0000 (1)</td><td>Display total visits</td>
 +
</tr>
 +
<tr>
 +
<td>0100000 0000 (2)</td><td>Display total unique visitors</td>
 +
</tr>
 +
<tr>
 +
<td>0010000 0000 (3)</td><td>Display total vote value (up votes - down votes)</td>
 +
</tr>
 +
<tr>
 +
<td>0001000 0000 (4)</td><td>Display total up votes</td>
 +
</tr>
 +
<tr>
 +
<td>0000100 0000 (5)</td><td>Display total down votes (as negative)</td>
 +
</tr>
 +
<tr>
 +
<td>0000010 0000 (6)</td><td>Display total visits for the current visitor</td>
 +
</tr>
 +
<tr>
 +
<td>0000001 0000 (7)</td><td>Display vote value for the current visitor</td>
 +
</tr>
 +
<tr>
 +
<td>0000000 1000 (8)</td><td>Display date and time of the first visit</td>
 +
</tr>
 +
<tr>
 +
<td>0000000 0100 (9)</td><td>Display date and time of the most recent visit</td>
 +
</tr>
 +
<tr>
 +
<td>0000000 0010 (10)</td><td>Display date and time of the first visit for the current visitor</td>
 +
</tr>
 +
<tr>
 +
<td>0000000 0001 (11)</td><td>Display date and time of the most recent visit for the current visitor</td>
 +
</tr>
 +
</table>
 +
  
 
[[Category:ContentMetrics]]
 
[[Category:ContentMetrics]]

Revision as of 11:18, 13 June 2010

ContentMetrics is added to a web site by configuring a ContentMetrics (CM) server and then registering the source web site that will communicate with the CM server.

Configuring the ContentMetrics server

A ContentMetrics server (%CM-SERVER%) can be hosted on any web server that has MySQL 5+ and PHP 5+. Current available servers are:

The source web site must be registered with a user profile name (%PROFILE-NAME%) and host name (%HOST-NAME%).

Configuring the source web site

The following style sheet and two JavaScript file must be added to the <head> section of any page that will communication with the CM server:

<link rel="stylesheet" type="text/css" media="screen"
    href="%CM-SERVER%/style/cm.css" />
<script type="text/javascript"
    src="%CM-SERVER%/javascript/prototype-1.6.0/prototype.js"></script>
<script type="text/javascript"
    src="%CM-SERVER%/javascript/cm.js"></script>

With these entries added, any number of regions can be added to the page. Each region will track metrics for that region and display configurable results:

<script type="text/javascript"
    src="%CM-SERVER%/region_create.php?id=%PROFILE-NAME%&region=%REGION-ID%&actions=%ACTIONS%&metrics=%METRICS%">
</script>
  • %REGION-ID% - A unique value within the registered %HOST-NAME%
  • %ACTIONS% - A bit mask of allowable actions for this view of the reigon:
Value (position)Description
100 (1)Record each visit
010 (2)Allow visitors to up vote
001 (3)Allow visitors to down vote
  • %METRICS% - A bit mask of what recorded metrics should be displayed:
Value (position)Description
1000000 0000 (1)Display total visits
0100000 0000 (2)Display total unique visitors
0010000 0000 (3)Display total vote value (up votes - down votes)
0001000 0000 (4)Display total up votes
0000100 0000 (5)Display total down votes (as negative)
0000010 0000 (6)Display total visits for the current visitor
0000001 0000 (7)Display vote value for the current visitor
0000000 1000 (8)Display date and time of the first visit
0000000 0100 (9)Display date and time of the most recent visit
0000000 0010 (10)Display date and time of the first visit for the current visitor
0000000 0001 (11)Display date and time of the most recent visit for the current visitor