4.8K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
Guide Me

Organizing Outbound Link Tracking

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi All!


Ok, so this thing is killing me... A client of mine's website is tracking Outbound URLs as Events in google analytics, however, we need to categorize these URLs as more than just event labels.


The site features links to 350+ organizations, some with over 8 links per organization (that do not have a common keyword). 


The goal would be to have the links grouped by organization. 


The only solution I have been able to come up with is to add a tracking code to each of an organization's links that we would then be able to use as a filter within analytics.


I am wondering if using google URL builder to generate these tracking codes for each link is my best option - or even an option at all ? 


And if not, what do my options look like?








Re: Organizing Outbound Link Tracking

Explorer ✭ ✭ ☆
# 2
Explorer ✭ ✭ ☆
The backend developers did something similar to on a site I work on. If on the report for Event Label you click the column for Event Label, it will resort them alphabetically which should group them by domain.

This only really works if you can modify the event tracking code. If you want more control of the groupings, you could try customizing the Event Action to something more descriptive to group them. So instead of Click it would be Org A Click or Org B Click or Org C Click.

&lt;script language="javascript" type="text/javascript"><!-- document.getElementById('MOS-eNews').addEventListener('click', function(){ga('send', 'event', 'External Link', 'click', 'website')}, false);// -->&lt;/script&gt;

Re: Organizing Outbound Link Tracking

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Regarding the alphabetical list - many of the links are social so that doesn't work.

The links are all on the same page, so the event action code being "click" registers all external link clicks (correct me if I'm wrong). How would we then be able to organize the URLs by org name?

Re: Organizing Outbound Link Tracking

Explorer ✭ ✭ ☆
# 4
Explorer ✭ ✭ ☆
The script for the listener activates on click, but it gets sent as function(){ga('send', 'event', 'External Link', 'click', 'website')} so you can customize the text for External Link(event catagory) , Click(event action), website(event label).

You are still tracking the clicks (metric), just changing the names displayed each step of the event tracking. You might also want to see if it is possible to set up Google Tag Manager from having to mess with coding overly much. It also demonstrates how you can tailor the names to better group things.

Organizing Outbound Link Tracking

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

I am using Go Daddy website builder. I cannot figure out why outbound analytics is not even showing up on my reporting dashboard. I have these lines of code in the HTML editor:


1. analytics.js tracking code


You can add <strong>HTML</strong> directly into this element to render on the page.<p><p>Just edit this element to add your own HTML.
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-I HAV EMY CORRECT NUMBER HERE']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src=('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);


2. Outbound script


* Function that tracks a click on an outbound link in Analytics.
* This function takes a valid URL string as an argument, and uses that URL string
* as the event label. Setting the transport method to 'beacon' lets the hit be sent
* using 'navigator.sendBeacon' in browser that support it.
var trackOutboundLink = function(url) {
ga('send', 'event', 'outbound', 'click', url, {
'transport': 'beacon',
'hitCallback': function(){document.location = url;}


3. onclick attribution (I am clueless about this one).. We want to see if people are going to our amazon page from our site (there is an amazon button).


You can add <strong>HTML</strong> directly into this element to render on the page.<p><p>Just edit this element to add your own HTML.
<a href="" onclick="trackOutboundLink(''); return false;">Check out</a>



Please help and thanks in advance!