Clicking-Through Tracking in Perl
By Randal L. Schwartz
If your Web site is like any of the other 180 million pages
out there, you've probably included links to other sites
from your own. They may be places you found relevant to particular
topics, or maybe you just published your bookmarks as part of
your site. So, I come along, visit your site, and notice a link
to an interesting page. I click on it, and move on. However, because
of the way the Web works, you'll have no indication that
I found that link interesting. You may even start wondering if
anyone finds the links in your carefully crafted Web page useful.
Wouldn't it be nice to somehow track when someone leaves
your site, and what route they take when they exit? It's
actually pretty easy to do, provided you're willing to take
a CGI hit on each link followed. Essentially, you'll need
to change all outbound links to CGI invocations. For example,
instead of using the anchor tag in
Figure 1(a), you could use
the code in
Figure 1(b). Although it looks like a URL toward the
end, it's really just data that shows up in the PATH_INFO
environment variable of the /cgi/go CGI script on the Web server.
Now, changing all your existing links to match this new requirement
may seem like a lot of work.