Can you track when a user prints a page off your website?

Status
Not open for further replies.


There are two ways I can think of, off the top of my head:

1. Send the user to a link, which tracks a user is printing the page, then redircets to a page that auto-prints using javascript. Link structure:

Code:
<a href="http://www.myblog.com/category/blog-post.html?print=1">Print Me</a>
And have the page call this javascript when it has print=1:

Code:
document.print();
2. use a function to print the page, but call a remote image that tracks the page:

Code:
function trackPrint()
{
    var printPixel = new Image();
    printPixel.src = "http://www.myblog.com/track/print.php?id=X";
    document.print();
}
Have the link to print be:

Code:
<a href="javascript:trackPrint();">Print Me</a>
#1 requires some PHP programming.
#2 not so much, since you could just check the logs to see how many times the /track/print.php is called.
 
Good idea! Those who press CTRL+P or use the browser menu to print will slip through this technique though. There is no way of tracking that.
 
If you have a custom print CSS you might be able to add ?page=xxx to the url string and track that via you web stats package.

Mubs
 
Another idea would be to use embedded user tracking, such as "heatmaps" from crazyegg.com or something similar to visualize what your visitors are touching on each page. I think Google Analytics has a feature like this. But for tracking the items used on each browser menu, you could remove those options for the visitor by placing them in a browser window that only allows your custom menu. Not sure if that will be reliable since there are many different types of browsers.

Besides, how are you going to track when people simply hit the "Print Screen" button on their keyboard, then copy and paste the screenshot into a document? I don't think you can really expect to keep track of every possible method of printing your webpage. Is your concern about digital rights management and copyrights?
 
This is kind of mentioned above, but write a script that tracks hits and outputs your printable stylesheet (media=print). This should catch all CSS enabled browsers when they print.

Ex:
Code:
<link rel="stylesheet" type="text/css" href="trackprint.php" media="print"/>

trackprint.php:
Code:
<?php
// tracking here
?>
<!-- stylesheet here -->
 
Status
Not open for further replies.