WordPress.org

Ready to get started?Download WordPress

Forums

Blunt GA
[resolved] How to use ga.js (10 posts)

  1. cnbscene
    Member
    Posted 1 year ago #

    How do I setup google analytics to use ga.js?

    Do i need the old code snippet?

    Can anyone point me to info on how to do this. I tried various searches but can't find anything.

    Thanks in advance!

    http://wordpress.org/plugins/blunt-ga/

  2. Hube2
    Member
    Plugin Author

    Posted 1 year ago #

    ga.js is the older code snippet and looks something like this:

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

    The new version that is in public beta is analytics.js. The code snippet for it looks something like:

    <!-- Google Analytics -->
    <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-XXXX-Y');
    ga('send', 'pageview');
    
    </script>
    <!-- End Google Analytics -->

    At this time, if you have you site set up to use either of them you can't convert Google Analytics Dashboard to use the other one.

    However, you can set up two properties in you Google Analytics Dashboard and track your site using both types. This is what Google is recommending.

    Here's an article about it: http://analytics.blogspot.com/2013/03/expanding-universal-analytics-into.html.

    Hope this information helps.

    I have plans to expand this plugin to work with the new tracking script as well as keep it compatible with the current script, I just haven't gotten there yet.

  3. cnbscene
    Member
    Posted 1 year ago #

    Cool I made a new property and linked it to my Blunt GA install.

    I see that in the real time I'm getting page views, but no events. Does it take 24 hours or so for full integration?

    Thanks again, I'm really excited to get this working!

  4. Hube2
    Member
    Plugin Author

    Posted 1 year ago #

    Testing now.

  5. Hube2
    Member
    Plugin Author

    Posted 1 year ago #

    It appears there is a problem with event tracking, I'm working on a fix for it now. More details here.

  6. Hube2
    Member
    Plugin Author

    Posted 1 year ago #

    I have uploaded a new version that should correct the event tracking issue. For more details see the topic about event tracking problem.

  7. cnbscene
    Member
    Posted 1 year ago #

    I tried updating the plugin and it crashed my install of wordpress. I renamed the plugin folder to blunt-gabak and it came back.

    I tried installing it fresh and it gave me the following fatal error:

    Warning: require_once(/home2/cnbscene/public_html/wynlv/wp-content/plugins/blunt-ga/tld/utils.php) [function.require-once]: failed to open stream: No such file or directory in /home2/cnbscene/public_html/wynlv/wp-content/plugins/blunt-ga/blunt.ga.class.php on line 4

    I was so pumped to try it! :( Is it something I did wrong?

    I don't see this directory path in on my server:
    /plugins/blunt-ga/tld/utils.php

    In fact I see no sub directories in either blunt-ga or the backup (blunt-gabak) that I made. There are 2 php files 2 js files a CSS file and some screenshots. That's it.

    Thanks again!

  8. Hube2
    Member
    Plugin Author

    Posted 1 year ago #

    I'm uploading a new version now.

    Between my rush to fix the bug and it being past my bed time I failed to include a required file.

  9. cnbscene
    Member
    Posted 1 year ago #

    Looks like its working now! I setup some goals for click to call and mailto.

    The events show immediately in the Realtime

    I'm guessing the conversions and events will start tomorrow when the "Content" section updates.

    Thanks for your quick response and help. I've tried every other plugin out there and everyone ignored my concerns.

    You rock!

  10. Hube2
    Member
    Plugin Author

    Posted 1 year ago #

    You're welcome.

    Honestly glad you brought up the problem. We use this for all of our clients and I was unaware that the event tracking had stopped working. It wouldn't have been till the next review before we noticed it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags