This is just a quick demo page. If you print or print preview this page and then click the button labeled "View Print Stats" you will see the date/time and your IP address in the detailed logs section of the stats page.
Your IP Address is: 52.14.176.111
View Print StatsTo use PrinTrac.php you simple upload a PHP file, Add a some section of code to your webpages, and add a bit of code to your print stylesheet.
Step 0: Download PrinTrac.php from GitHub
The first thing you need to do is upload printrac.php
to your website, for example to its own directory. Next you need to create a new directory in the same folder that printrac.php
is in, so it can have a location to store the logs. You need to create a directory named logs
.
Now that PrinTrac.php
is on your website you need to add the following code to your webpages. Place the below code right before the closing body tag on your webpages
<!-- PrinTrac.php Tracking Code - http://madscitech.com/m/10 -->
<script src="/path/to/printrac.php?js"></script>
The last thing you need to do is add the following code to your print stylesheet:
body:after, .printracphp-ie{
background:url(/projects/printracphp/printrac.php?track) no-repeat;
content: url(/projects/printracphp/printrac.php?track);
width: 1px;
height: 1px;
display: block;
}
If you don't have a print stylesheet, you can create one very easy. The easiest way is to put your current CSS into a media declaration by surround all of your css with:
@media screen{
# Your Current CSS is here
}
Then add the above code either above or below your the current CSS that is now wrapped with the @media print
.
That's it! PrinTrac.php is now installed!
To test it out, print preview a page with the tracking code and the new CSS on it - then navigate to: http://your-domain-name.example.com/path/to/printrac.php?gui
and you should see a print recorded!
To view the pretty logs that PrinTrac.php create, point your web browser to
http://your-domain-name-here.example.com/full/path/to/printrac.php?gui
http://www.your-domain-name.com/the/full/path/to/the/file/printrac.php?gui
.