Knowledge Base

HTML Code For Tracking Website Visitors Using 'Web Traffic Analysis'


Note: Before you can use Web Traffic Analysis, you will need an account set up on our main hosting server. Please contact our technical support via email to arrange this. Once you have an account set up, we will provide you with your own URL to view your website activity.

'Web Traffic Analysis' gives you the ability to track in real-time visits to your website(s). When you include the tracking code in the HTML of your web pages, our database stores various pieces of data about your visitors:
  • Date and time of visit
  • Visitor IP Address (Which can be used to find out the visitors host name)
In addition to the above, if the visitor's browser has JavaScript enabled (which most do), we also store the following:
  • The referring page URL (Which website address the visitor came from)
  • Which browser the visitor used
  • The version of the browser
  • The screen resolution

HTML Code For NON-FRAMED Websites:

<!-- BEGIN pctrends.com WEBSTATS CODE / NON-FRAMED SITE VERSION (IMAGE) -->
<!-- The following code passes page information to our custom script on the webserver.. -->
<script type="text/javascript">
<!--
	document.write('<img border="0" width="0" height="0" src="http://www.pctrends.com/pctrends_scripts/webstats.php?image=transparent&acc=pct-XXXXXXX&ref1=YYY&ref2=ZZZ');
	document.write('&referer='+escape(document.referrer));
	document.write('&browser='+escape(navigator.userAgent));
	document.write('&browserversion='+escape(navigator.appVersion));
	document.write('&screenx='+screen.width);
	document.write('&screeny='+screen.height);
	document.write('" />');
// -->
</script>
<noscript>
	<img border="0" width="1" height="1" src="http://www.pctrends.com/pctrends_scripts/webstats.php?image=transparent&acc=pct-XXXXXXX&ref1=YYY&ref2=ZZZ&referer=no-javascript">
</noscript>
<!-- END pctrends.com WEBSTATS CODE / NON-FRAMED SITE VERSION (IMAGE) -->

The default image, transparent, can be replaced with one of the following:
  • pctrendstracking - Displays a short message telling the user who does your visitor tracking

HTML Code For FRAMED Websites:

<!-- BEGIN pctrends.com WEBSTATS CODE / FRAMED SITE VERSION (STYLESHEET) -->
<script type="text/javascript">
<!--
	document.write('<link rel="stylesheet" type="text/css" href="http://www.pctrends.com/pctrends_scripts/webstats.php?image=stylesheet&acc=pct-XXXXXXX&ref1=YYY&ref2=ZZZ');
	document.write('&referer='+escape(document.referrer));
	document.write('&browser='+escape(navigator.userAgent));
	document.write('&browserversion='+escape(navigator.appVersion));
	document.write('&screenx='+screen.width);
	document.write('&screeny='+screen.height);
	document.write('" />');
// -->
</script>
<noscript>
	<link rel="stylesheet" type="text/css" href="http://www.pctrends.com/pctrends_scripts/webstats.php?image=stylesheet&acc=pct-XXXXXXX&ref1=YYY&ref2=ZZZ&referer=no-javascript">
</noscript>

<!-- END pctrends.com WEBSTATS CODE / FRAMED SITE VERSION (STYLESHEET) -->

The following replacements should be made to the above code:
  • XXXXXXX - Replace with your 7 letter pctrends.com account code.
  • YYY/ZZZ - Replace with an optional, customised piece of text of up to 40 characters in length (e.g., perhaps the name of the subpage on your site). This will be stored in the database with the other information we collect.