0
Welcome Guest! Login
0 items Join Now

New Google Analytics 'Async Track' in Gantry theme panel

    • Roy Warner's Avatar
    • Roy Warner
    • Sr. Rocketeer
    • Posts: 126
    • Thanks: 2
    • got Answers?

    New Google Analytics 'Async Track' in Gantry theme panel

    Posted 12 years 9 months ago
    • I noticed that Google Analytics revamped their system - not just the dashboard, but the entire code.
      I certainly do Not know how to access the older style dashboard. If there is a way to continue to use the old format of GA, then I suppose it buys everyone - developers and users - more time before they have to migrate.

      In any case, are there any Gantry updates (or updates in development) so that rocketthemes GA control panel module will be able to use the new 'Async Tracking'?


      Reference
      Migrating to Async Tracking instructions at the following URL: developers.google.com/analytics/devguide...yncMigrationExamples
    • -Roy-
    • Ben Lee's Avatar
    • Ben Lee
    • Elite Rocketeer
    • Posts: 4193
    • Thanks: 42

    Re: New Google Analytics 'Async Track' in Gantry theme panel

    Posted 12 years 9 months ago
    • The code in Gantry 3.2.22 which is the most current version right now shows that this is already in effect:
      // start of Google Analytics javascript
                ?>
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', '<?php echo $this->get('code'); ?>']);
        _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);
        })();
                <?php
                // end of Google Analytics javascript


      The code from the article you linked to shows this:
      Async Snippet (recommended)
      _gaq.push(['_setAccount', 'UA-XXXXX-X']);
      _gaq.push(['_trackPageview']);

      Traditional (ga.js) Snippet - would have looked like this instead:
      var pageTracker = _gat._getTracker('UA-XXXXX-X');
      pageTracker._trackPageview();

Time to create page: 0.056 seconds