Analytics
5.9K 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

tracking outbound links

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I am new to Google Analytics.  Can I track all outbound links from my website with some sort of user ID so I can see who clicks on specific links?

1 Expert replyverified_user

Re: tracking outbound links

Top Contributor
# 2
Top Contributor
Hi, Ernie C,

One possibility is to associate a hashed user ID (or identifier) as a hit-scoped custom dimension to all your outbounds. Note that you can't use an ID that could potentially identify a specific individual (also known as Personally Identifiable Information or PII).
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: tracking outbound links

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Nicky Y - so a PII is illegal? or not cool with Google? or just bad karma?
Marked as Best Answer.
Solution
Accepted by Bronwyn V (Top Contributor)
August 2016

Re: tracking outbound links

Top Contributor
# 4
Top Contributor
Hi, Ernie,

PII is not illegal per se and it may happen inadvertently sometimes, but Google strictly forbids it from being collected and stored on their servers. See section 7: https://www.google.ca/analytics/terms/us.html. If in doubt about what is considered PII, you should consult your legal team or counsel for direction. If you are collecting and storing PII and Google finds out, then bad things will happen. Smiley Very Happy
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

tracking outbound links

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!