Google Analytics Widget - Tracking code

2460
4
Jump to solution
05-30-2012 08:24 AM
AshleyPeters
Occasional Contributor III
All,

I downloaded the Google Analytics Widget and have added it into my viewer. Everything seems to be working properly, but I'm not showing any hits so far on the Google Analytics accounty. I believe my issue stems from having not yet placed the tracking code I received when I registered on Google Analytics. Can anyone give me some guidance as to where I need to place this code or some possible troubleshooting ideas?

Thanks in advance!

Ashley
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
philippschnetzer
Occasional Contributor III
once you have the google analytics widget all set, you need to put this into the index.template.html (inside the <head> tags):

<script type="text/javascript">     var _gaq = _gaq || [];    _gaq.push(['_setAccount', 'UA-########-##']);    _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>


And, of course, go to your analytics account, register the domain and then insert the code above where it says 'UA-########-##'.  Then it might take a day or so to register anything on your account...maybe just a few hours...

View solution in original post

0 Kudos
4 Replies
philippschnetzer
Occasional Contributor III
once you have the google analytics widget all set, you need to put this into the index.template.html (inside the <head> tags):

<script type="text/javascript">     var _gaq = _gaq || [];    _gaq.push(['_setAccount', 'UA-########-##']);    _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>


And, of course, go to your analytics account, register the domain and then insert the code above where it says 'UA-########-##'.  Then it might take a day or so to register anything on your account...maybe just a few hours...
0 Kudos
AshleyPeters
Occasional Contributor III
Knowing to insert the tracking code into the index.html is what I was missing. Thank you!
0 Kudos
MLowry
by
Occasional Contributor II
What version viewer is it actually working on? 2.5?
0 Kudos
AshleyPeters
Occasional Contributor III
Yes, I have it working on 2.5.
0 Kudos