[Zope] Link counter

Chris Gray cpgray@library.uwaterloo.ca
Sun, 3 Dec 2000 11:47:24 -0500 (EST)


You want something like this in your linking page:

<form action="count_and_pass">
<input type="hidden" name="target_url" value="http://www.zope.org/">
<input type="submit" value="Go to Zope.org">

OR

<a href="count_and_pass?target_url=http%3a//www.zope.org/">Go to
Zope.org</a>

Then you need a 'count_and_pass' DTML Method like:

<dtml-call increment>
<dtml-call expr="RESPONSE.redirect(_['target_url'])">

and a ZSQL Method called 'increment' that takes 'target_url' as an
argument and increments the count for that URL.  Or you can get fancier
and use the ZSQL method to record each click through along with date and
info like the users IP and the refering page.  These last will be in the
REQUEST from the linking page.

Cheers,
Chris

On Sun, 3 Dec 2000, Brendon Grunewald wrote:

> I have recently been asked by a partner site to provide them with a count of how many times someone links from my site to theirs. Since there are many ways they could hyperlink to that site (Squishdot articles, normal links, banner ads etc), is there a way in zope to keep track or to extract that info? OR am I stuck with the server logs?
> 
> Regards,
> Brendon
> ------------------
> 70South: the No.1 source for Antarcticles.
> For the latest news and views on Antarctica visit : http://www.70south.com
>