BBC External Link Tracking Script
Links are still clean and there is nothing in the source code to indicate that they pass through a redirect. However when you click on any external link users are still sent through a tracking script.
This might be a very useful script for some of you who want to track links but still pass SEO benefits, the original is here. For a demo visit this page and click the “Movie Review Query Engine” link.
var LinkTrack = function ()
this.docLinks = document.links;
LinkTrack.prototype.updateHrefs = function ()
var currlink, hostname, protocol, linktext;
if (!(!document.getElementsByTagName && document.all))
for (var i=0; i
currlink = this.docLinks[i];
hostname = currlink.hostname ? currlink.hostname.toLowerCase() : "";
protocol = currlink.protocol.toLowerCase();
linktext = currlink.innerText;
if (protocol == 'http:' && (hostname != 'bbc.co.uk' && hostname.indexOf('.bbc.co.uk') == -1))
currlink.href = this.getNewUrl(currlink.href);
if (document.all && currlink.innerText.toLowerCase() == currlink.href.toLowerCase()) currlink.innerText = linktext;
LinkTrack.prototype.getNewUrl = function (destination)
var newUrl = '/go';
newUrl += this.location;
newUrl += (newUrl.substr(newUrl.length-1) == '/')? 'ext/_auto/-/' : '/ext/_auto/-/';
newUrl += destination;
var myC = new LinkTrack();
Latest from B3Labs
- Another milestone reached for Branded3 as it’s acquired by the
St Ives Group
- The latest media consumer findings & what they mean for digital marketers
- Talk to Branded3 at @BuyYorkshire in Leeds next week!
Latest from Blogstorm
- After five years, Google still doesn’t know how to rank images
- Tickets now on sale for the next #B3Seminar in London – book now!
- Google Only Shows One Organic Result To iPad Users