diff --git a/Repositories/otago_eprints/otago_eprints/cfg/ArchiveRenderConfig.pm b/Repositories/otago_eprints/otago_eprints/cfg/ArchiveRenderConfig.pm index f42f7d0..032b4a9 100755 --- a/Repositories/otago_eprints/otago_eprints/cfg/ArchiveRenderConfig.pm +++ b/Repositories/otago_eprints/otago_eprints/cfg/ArchiveRenderConfig.pm @@ -153,17 +153,24 @@ # NJS 2007-07-30: Add Google Analytics tracking code to link. my $rendered_cite = $doc->render_citation_link(); + + # Strip the front off the URL to get just the document path. + my $doc_url = $doc->get_url; + $doc_url =~ m|^http://[^/]+(/.+)$|; + my $docpath = $1; + # Ugh, DOM sucks... # Find the first element in the DocumentFragment and add the # onclick attribute to it. $rendered_cite->getElementsByTagName('a')->item(0)->setAttribute( 'onclick', "javascript:urchinTracker( '" . - $doc->get_url . + $docpath . "' );" ); $doctd->appendChild( $rendered_cite ); + ##END # !!! original code follows # $doctd->appendChild( $doc->render_citation_link() ); my %files = $doc->files; @@ -833,7 +840,12 @@ my $a = $session->render_link( $url ); # NJS 2007-07-30: Add Google Analytics tracking code to link. - $a->setAttribute( 'onclick', "javascript:urchinTracker( '$url' );" ); + # Strip the front off the URL to get just the document path. + $url =~ m|^http://[^/]+(/.+)$|; + my $docpath = $1; + + $a->setAttribute( 'onclick', "javascript:urchinTracker( '$docpath' );" ); + ##END $a->appendChild( $session->make_element( "img",