SMF Support > SMF 2.0.x Support

Can't get Analytics to work

(1/3) > >>

Franciscus:
I tried modifying all themes as per the various instructions on this forum, did not work.

I tried the Analytics mod, it does not install properly so it did not work.

I tried pasting it into the footer of the Global Headers and Footers mod, it did not work.

I am webmastering dozens of sites and I never ran into problems with getting Analytics to work, but this time I'm really stumped, especially because I can see the analytics code in the page source, and it looks allright, except for the HTML entity encodings substituted for apostrophes etc. So I suspect that to be a potential problem.

Can anyone shine a light on this? Hyper-detailed instructions to the quantum-mechanical level on how to get it working?

Mick.:
What happens when it doesnt work?

Franciscus:
Nothing :-)

For the past days, Google claims it can't see the tracking code. Or at least it registers zero visits, whilst our forum is visited by hundreds/day..

cyberhat:
am having the same problem smf is making me tired no body with solution

Mick.:
I dont know how you two cant get it to work but this is how ive done it.

Open index.template.php of the theme youre using.

Find:

--- Code: ---</head>
--- End code ---

..and add your code before the head closing tag.

This is my code....

--- Code: ---<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push([\'_setAccount\', \'UA-32812462-1\']);
  _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>
--- End code ---

Notice the back slashes? Google provides the code without it, therefore it will break the forum. Add the slashes and wolla.

btw, i just added the code a few minutes ago on my site. Im seeing it working in 'real-time'.

Navigation

[0] Message Index

[#] Next page

Go to full version