Clickthrough

part of the ArsDigita Community System by Philip Greenspun
Here's the data model (from /packages/acs-core/community-core.sql):

create table clickthrough_log (
	local_url	varchar(400) not null,
	foreign_url	varchar(300) not null,	-- full URL on the foreign server
	entry_date	date,	-- we count referrals per day
	click_count	integer default 0
);
Note that we key this table by the URL on our server rather than by a page ID. Note further that this local URL does not include the beginning / (a legacy from the old days but I guess it is OK). This enables page authors to build pages without being aware of the internal page_id by which our system might know the comments or links associated with a page. Here's what a link out reference looks like:

<a href="/ct/photo/where-to-buy?send_to=http://www.bhphotovideo.com/">B&H Photo</a>
This is a reference on the page http://photo.net/photo/where-to-buy, sending readers over to http://www.bhphotovideo.com/.

For legacy sites that used to log clickthroughs with my old system, there is a parameter in the ad.ini file that lets you specify a custom regular expression to permit old-style references that include a realm, e.g.,


<a href="/ct/philg/photo/where-to-buy?send_to=http://www.bhphotovideo.com/">B&H Photo</a>
Here's the necessary magic from my ad.ini file:

[ns/server/photonet/acs/click]
CustomREGEXP=/ct/philg/(.+)$

philg@mit.edu