NetTalk Central

Author Topic: NT WS and GoogleAnalytics  (Read 2724 times)

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
NT WS and GoogleAnalytics
« on: May 22, 2013, 02:10:55 PM »
Did all of this a few weeks ago already - does not work - it show me no visits stats at all!
How do I resolve this?
http://www.medxinfo.co.za

<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','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-401949-3', 'medxinfo.co.za');
  ga('send', 'pageview');



</script>

[attachment deleted by admin]
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: NT WS and GoogleAnalytics
« Reply #1 on: May 22, 2013, 07:52:17 PM »
Hi Johan,

I just took a brief look at the site.  It wouldn't work at all for me earlier today, but seems to be working now.

It looks like you have got the Google Analytics code in a separate .js file?  I don't know if it will work that way.  If memory serves me correctly, I think Google needs that <script> section to be embedded within the actual page, and not in a separate .js file?  In any case, I cannot see the script anywhere on the home page, so perhaps in only comes up once logged in?

Also, I noticed in the source code that the line:

<script src="/scripts/googleanalytics.js" type="text/javascript"></script>

comes up TWICE in the main page - could be causing an issue if that is the case.

Hope this helps.

Cheers,
Devan