How do I know how often an external link is clicked?

This page: http://funds.ft.com/CityofLondon/investmentmanagement/HCEWUR contains a number of links in the Annual Reports and Newsletters section. The content referenced by these links is hosted at fundlibrary.co.uk, a third-party provider.

Is there a way to track how often these links are clicked? We do not have access to third-party web server logs.

One way, I think, is to have the POST instruction increment the score with jQuery every time the link is clicked, but that means we need to maintain the count.

Are there any features in Google Analytics that could provide us with this information?

+4
source share
4 answers
+3
source

You can use jQuery to send an event to Google Analytics when the link is clicked if you use the asynchronous snippet of Google Analytics tracking . Sort of:

$(document).ready(function(){ $("a").click(function(){ _gaq.push(['_trackEvent', 'Links', 'Followed', $(this).attr("href")]); return true; }); }); 

The following is a guide to tracking events in Google Analytics.

+3
source

Google analytics will tell you how many page exits for a given period of time. He cannot tell you where they went, though, if not for another page on your site. If you want to register where they were, then you probably need to do javascript to send information to the server when clicked.

You can feed all your external links, although the page is on your site, put the URL in the query line, then process the request, add it to your tracking tables, and then redirect them to where they wanted to go, but then you will need to change each The link you want to track.

0
source

I see that you are using the old GA script tracking version (and not the new asynchronous version) and that you open the links in a new window (using target="_blank" in the <a> tag). Given this, you just need to add code to register pageviews when you click a link:

 onClick="pageTracker._trackPageview('page_name');" 

This will register a pageview with the page_name page that appears in the reports. This type of page view is called "virtual page view." Of course, you should choose the appropriate names for placement in reports based on where the links go. You could extract the names from the href link.

Note that another way to do this is to use event tracking instead of virtual page views, but the main idea will remain the same (call it in the onClick event). Different people have different opinions about which one to use, so you should read it to decide which is more useful for your situation.

Also note that if you did not open a new window / tab for the link, you will need to use a timeout to delay loading a new page for a few milliseconds until a tracking beacon is transmitted.

0
source

Source: https://habr.com/ru/post/1347759/


All Articles