SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Google Analytics not working....

    Could someone please look at my code here: http://www.mynewheightsfitness.com

    <script type="text/javascript">
    //<![CDATA[
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-33318600-1']);
    _gaq.push(['_setDomainName', 'mynewheightsfitness.com']);
    _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>



    I have inserted the Google Analytics tracking code provided to me, copied & pasted directly yet Analytics continually says that the tracking code has not been set-up. I have double checked the UA numbers and they are the ones corresponding to their account.

    What could be the problem?

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,858
    Mentioned
    206 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    I have Google Analytics set up on several sites and I just compared your code with mine.
    The only difference I could see, was in the following lines:

    var ga = document.createElement('**script');
    var s = document.getElementsByTagName(**'script')[0];

    On my sites these lines read:

    var ga = document.createElement('script');
    var s = document.getElementsByTagName('script')[0];

    i.e. there is no double asterisk proceeding the word script.

    Other than that, it might be the case that Google Analytics takes a while to start tracking a site.

    I have no idea if this is relevant, but hope it helps anyway.

  3. #3
    Non-Member Dynamic_Systems's Avatar
    Join Date
    Sep 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the past we had the following problem in our site <snip>. When the new version was launched, we made a PHP script that was sending us an email each tome somebody enters a page. The email was containing the page's name and visitor's IP. So within one day we were receiving much more emails rather than the number of visitors displayed in Google Analytics. So I don't trust it much.
    Last edited by TechnoBear; Sep 23, 2012 at 04:36. Reason: Unnecessary URL removed.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •