How to know how often an external link is clicked?
This page: http://funds.ft.com/CityofLondon/investmentmanagement/HCEWUR contains a number of links under the section "Annual Reports & Factsheets". The content these links point at is hosted at fundslibrary.co.uk, a 3rd party supplier开发者_Go百科.
Is there any way for us to track how often these links are clicked? We don't have access to the 3rd party web server logs.
One way I'm thinking is to POST an instruction to increment a count with jQuery every time the link is clicked, but that would mean us having to maintain the count.
Is there any functionality in Google Analytics that could give us this info?
You could use Google Analytics Event Tracking http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html
You could use jQuery to send an event to Google Analytics when a link is clicked upon if you are using the Google Analytics asynchronous tracking snippet. Something like:
$(document).ready(function(){
$("a").click(function(){
_gaq.push(['_trackEvent', 'Links', 'Followed', $(this).attr("href")]);
return true;
});
});
Here is the guide to tracking events with Google Analytics.
Google analytics will tell you how many exits for a page in a given time period. It cannot tell you where they went to though unless it was to another page in your site. If you want to log where they went when that then you probably would need to do some javascript to send the information back to the server on the click.
You could feed all your outside links though a page on your site, put the url in the query string, then you process the request add to your tracking tables, and then redirect them to where they wanted to go, but then you would have to change every link you want to track.
I can see that you're using the old version of the GA tracking script (not the newer asynchronous version) and that you're opening the links an a new window (using target="_blank"
in the <a>
tag). Given this you just need to add code to register a page view when the link is clicked:
onClick="pageTracker._trackPageview('page_name');"
This will register a page view against a page called page_name
that will appear in reports. This type of page view is called a "virtual Page View". You should, of course, choose suitable names to put into the reports based on where the links are going. You could possibly extract the names from the href
of the link.
Note that another way of doing this would be to use event tracking instead of virtual page views but the basic idea would remain the same (call it in the onClick
event). Different people have different opinions about which one to use so you should read up on it to decide what's more useful for your situation.
Also note that if you weren't opening a new window/tab for the link then you would need to use a timeout to delay loading of the new page for a few milliseconds until the tracking beacon had been transmitted.
精彩评论