A few people have emailed me for more information about how to log clicks on the external 856 links in HIP, so here’s how to do it!
Requirements:
- a web server on which you can run a script (e.g. Perl or PHP)
- HIP 2 or 3
The 856 links in HIP are built from the MARC map in Horizon, so the first step is tweak it so that it prepends the URL of a logging script in front of the actual 856 URL. Here’s what our 856 MARC $u map looks like (split across several lines for readability):
<a class="smallAnchor" href="https://library.hud.ac.uk/cgi-bin/cataloguelink.pl?$_"> {<img src="$9"{ alt="$y"}>|$z|$y|$_} </a>
To view the MARC map without line breaks (i.e. as you’d enter it into Horizon), click here.
Please remember to make a note of the original 856 MARC map value – you might need it!
The https://library.hud.ac.uk/cgi-bin/cataloguelink.pl bit will need to be changed to the location and name of your logging script.
My first version of the logging script simply logged the URL and the time, as I couldn’t figure out a way of capturing more useful info (such as the bib number or book title).
So, I brewed myself an extra strong coffee and sneaked up on the problem from a different angle!
Continue reading “logging yer 856’s!”