Creating a tracker
All trackers using our system use a code snippet similar to this one:
<script>
var _pxl = _pxl || [];
_pxl.push({ hpy_campaign: [NUMBER], hpy_client: [NUMBER] });
(function() {
var px = document.createElement('script'); px.type = 'text/javascript'; px.async = true;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(px, s);
px.src = ('https:' == document.location.protocol ? 'https://www.pxcels.com.global.prod.fastly.net' : 'http://www.pxcels.com') + '/scripts/pxcel.js';
})();
</script>
<noscript><img src="http://www.pxcels.com/1x1.gif?hpy_dance=[NUMBER]&hpy_client=[NUMBER]" /></noscript>
Each tracker snippet must include at least 'hpy_client', which includes the client identifier specified by altascale. Anything else may be tracked by adding other parameters that start with "hpy."
For example:
<script>
var _pxl = _pxl || [];
_pxl.push({ hpy_campaign: 55, hpy_client: 34 });
(function() {
var px = document.createElement('script'); px.type = 'text/javascript'; px.async = true;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(px, s);
px.src = ('https:' == document.location.protocol ? 'https://www.pxcels.com.global.prod.fastly.net' : 'http://www.pxcels.com') + '/scripts/pxcel.js';
})();
</script>
<noscript><img src="http://www.pxcels.com/1x1.gif?hpy_dance=55&hpy_client=34" /></noscript>
This will cause the result to include "55" and "34" as values in the last two fields in the returned result logs.
Using a tracker
The variables will appear as columns at the end of the log - specifically, columns higher than the 18th.
Log results
A typical log result entry currently looks like this:
<134>2015-04-28T14:29:20Z cache-atl6220 PxcelLogs[476797]: Tue, 28 Apr 2015 14:29:20 GMT|Tue, 28 Apr 2015 14:29:20 GMT|162.212.88.98|Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36|(null)|/1x1.gif?hpy_f=71b0a2867fb493207a4afa30ce339894&hpy_campaign=3&hpy_client=54|GET|304|28.514|-81.443|Orlando|NA|US|USA|United States|32811|FL|407|534|71b0a2867fb493207a4afa30ce339894|3|54
This script is a combination of 21 pipe-delimited columns that are defined by the system, and any number defined by people using the script snippet.
Log Values
- Fastly generated log start (everything before the ":")
- Current DateTime
- Client IP Address
- User Agent
- Cookie from the client
- Full URL
- Request type (GET, or POST)
- Request status Code (probably always 200)
- Latitude
- Longitude
- City
- Country Code
- 3 Letter Country Code
- Full Country Name
- Postal Code
- Geological Region
- Phone Area Code
- Metro Code
- Fingerprint
- Client Identifier
- Campaign Identifier