Monday, March 14, 2011

oneSearch bookmarklet @ LibTech 2011

On March 17th (this Thursday,) I'll be presenting at the Library Technology Conference on the oneSearch bookmarklet tool created by Barbara Arnett and I.

Barbara won't be able to make it out to Minnesota (she'll be presenting the bookmarklet to the NJLA 2011 Technology Innovation Award committee,) but because we want to be as practical as possible in our presentations, she put together a quick reference for the three parts of the bookmarklet (you don't actually need the third piece, it just creates a nice button for users to drag and drop into their browser, as opposed to a simple link.)

Below is the code you'd need to get started working on your own browser-based search bookmarklet:


(1)HTML, (2)Javascript & (3)CSS:


1 - HTML to display bookmarlet on your webpage:


(edit this line: {document.body.appendChild(document.createElement('script')).src='http://www.stevens.edu/library/js/search.js';}
so that the red text links to the JavaScript file you place on yo
ur server)


2 - Javascript to sit on your server (sits in search.js, referenced in bookmarklet HTML)


(edit this line: _gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
so that the red text reflects your own Google Analytics account number (you can also find this complete code within GA, in actions->edit->check status,)
and this line: var searchString='http://ezproxy.stevens.edu/form?qurl=http://XXXXXXXX.cs....&field=title&term='+(Ti);
so that the red text reflects your own search URL, which you can get from your catalog, database or federated search vendor)

(Note: if you don't want to use Google Analytics, just remove all the code before the line: var Ti=document.title.replace('- Wikipedia, the free encyclopedia','');)


3 - CSS needed for the button:


(You can do this as inline CSS or a separate stylesheet. Just replace the background image with your own image file.)

-------------------------------------------------------------
***OR, if you'd rather just download all the files, edit them, and place move them to the appropriate locations on your server, you can download the file packet (with instructions in a ReadMe.txt file.)***
-------------------------------------------------------------

Presentation slides:



One note: when we developed the bookmarklet, we were beta-testing Ebsco Discovery Service. We have since switched to Serial Solutions' Summon, but while that's being configured, the bookmarklet used our integrated search (also a Serial Solutions product.)

On the down-side, this has caused some inconsistency in our screenshots (the slides feature EDS screenshots, since we don't have full access to Summon yet.) However, this does emphasize the importance of having the full code reside on your server, as we've been able to make the required adjustments to the code without users having to re-install the tool.

3 comments:

Aarontay said...

Hi Val. What I find most interesting about your bookmarklet is the use of Google Analytics.

I was wondering whether it can be used for all bookmarklet in general, like for example many libraries have a proxy bookmarklet like http://www.lib.umich.edu/mlibrary-labs/proxy-server-bookmarklet that adds the proxy stem to the page the user is on.

The problem with this is you can't tell how often users are using the bookmarklet.

Could one convert it to a externally linked JS, that calls Googleanalytics function?

barbara said...

@Aarontay - yes, that can be done. I tried it out with our proxy server and Google analytics, here's the javascript for the external file:

{
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx-1']);
_gaq.push(['_setDomainName', '.xxxxxxx.edu']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
location.href='http://ezproxy.stevens.edu/login?url='+location.href;
}

Google analytics can take 24-48 hours to log everything, so I'm waiting to see if we get all the clicks logged, so far it's showing one visit. The URL proxy reloading part worked from off campus, so give it a try!
-Barbara

Aarontay said...
This comment has been removed by the author.

Post a Comment