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

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?

 

Thanks,

 

B

 

 

 

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. https://youtu.be/opTWMrj-rLU?t=5m9s

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.
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-I HAV EMY CORRECT NUMBER HERE']);
_gaq.push(['_trackPageview']);

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

 

2. Outbound script

 

<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;}
});
}
</script>

 

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). https://www.amazon.com/FSTI-12-5-Sodium-Hypochlorite-Bleach/dp/B01J4ERF3W

 

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="https://www.amazon.com/FSTI-12-5-Sodium-Hypochlorite-Bleach/dp/B01J4ERF3W" onclick="trackOutboundLink('https://www.amazon.com/FSTI-12-5-Sodium-Hypochlorite-Bleach/dp/B01J4ERF3W'); return false;">Check out example.com</a>

 

 

Please help and thanks in advance!