Analytics
2.3K members online now
2.3K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Cannot Get Outbound Analytics To Work

Visitor ✭ ✭ ✭
# 1
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!

1 Expert replyverified_user

Cannot Get Outbound Analytics To Work

Top Contributor
# 2
Top Contributor

Hi,

 

You need to update your main tracking code to universal analytics. You'll find the tracking code in Admin -> Property -> Tracking Info -> Tracking code. Once you update the tracking code, the ga() commands will be available. Let me know once you update the tracking code and we'll see if there are any other issues. Thanks!

 


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Cannot Get Outbound Analytics To Work

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thanks in advance..

 

I changed my analytics.js script to Universal:

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-number', 'auto');
ga('send', 'pageview');

</script>

 

Nothing changed in my Analytics Dashboard (I searched for outbound on reporting and nothing came up).

 

What should I do now?

Thanks

 

Cannot Get Outbound Analytics To Work

Top Contributor Alumni
# 4
Top Contributor Alumni

hey

Your code looks good, Can you post your page link?

Regards, Nik
LinkedIn  |   @nikhilparachure | My Blog

Cannot Get Outbound Analytics To Work

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

fstipoolchemicals.com

 

Cannot Get Outbound Analytics To Work

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

What should I do now?

 

Cannot Get Outbound Analytics To Work

Top Contributor
# 7
Top Contributor

Hi,

 

You are double tracking your property, you are tracking both using the universal analytics code snippet and using an universal analytics tag through Google Tag Manager. You should keep only one of them. Event tracking is different for the two implementations, you need to decide first if you want to keep the tracking snippet or the tag in GTM. The event tracking code should work with the new code snippet, did you check if the events are recorded under Behavior -> Events?

 


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Cannot Get Outbound Analytics To Work

Top Contributor Alumni
# 8
Top Contributor Alumni

Hi @Arnold M +1

@Stormey B you have 2 instances of GA on your webpage and that will require further customization of code so unless you have a specific need to keep 2 instances you should keep only one.  

Also at the moment I think UA-84490406-2 this property should be recording your event even now. 

Hope this helps

 

Regards, Nik
LinkedIn  |   @nikhilparachure | My Blog