Results 1 to 7 of 7

Thread: Google analytics 0 Contao 2.9.0

  1. #1
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Google analytics 0 Contao 2.9.0

    You used to be able to enter you GA code in a field in expert settings in a layout.

    In Contao 2.9.0 it seems to have disappeared.

    Any ideas where I can find it now?

  2. #2
    User
    Join Date
    06-20-09.
    Posts
    115

    Default Re: Google analytics 0 Contao 2.9.0

    haven't tried it but there was a note accompanying the release of 2.9:
    Important notice

    There are two things that you have to manually adjust after the update. First of all, the global page template fe_page has been modified, so if you are using a custom version, make sure to change it accordingly. Second of all, we have removed Google Analytics support from the core and added a template called moo_analytics instead. If you want to use Google Analytics, edit the template and enter your Urchin ID there (follow the instructions in the file). Then add it as the last (!) MooTools template to your page layout.
    http://www.contao.org/news/items/contao-2_9_0.html
    geung

  3. #3
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: Google analytics 0 Contao 2.9.0

    A Google Analytics extension has also been written, available in the repository. This adds the GAID to site root pages which is even better then the way it was. :D

  4. #4
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: Google analytics 0 Contao 2.9.0

    Thanks for your help Geung, and thanks for the heads up Vera.

    I have installed the extension and it works a treat.

    Only problem is the Google code is placed just before the </body tag. I believe Google now recommends that it is placed just before the </head> tag.

  5. #5
    New user
    Join Date
    08-27-10.
    Posts
    14

    Default Newbie could use help with this

    If anyone could post more explicit instructions on how to use the moo_analytics option, or point me to where they are posted, I'd be most appreciative. I've just taken over maintenance of a site that is using Typolight v 2.7.6 and so the extension won't work for me at this point.

    Thanks for any help.

  6. #6
    User
    Join Date
    06-19-09.
    Posts
    89

    Default Re: Google analytics 0 Contao 2.9.0

    In version 2.7.6 there should be an option to add the ga code in your page layout.

  7. #7
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default Re: Google analytics extension does not validate with Google

    I've been using the googleanalytics (Tag "analytics" in extension catalog) extension with good results, relatively easy to implement in previous versions of TYPOLight, but this seems to no longer be the case with Contao v2.9.1 and the Google Analytics code including the requirement that it be placed ABOVE the closing head tag.

    I have a new website that I've finished for a client http://www.AlphaPhiECU.org/ that was built using Contao 2.9.1. I've spent two hours trying to get the Analytics module to validate with Google and it consistently fails validation with Google Analytics and a Google recommended third party troubleshooting utility http://www.SiteScanGA.com/ . Evne though I could see the code in the page "View Source", it failed validation until I added it to the .tpl files for the website.

    This is working for me at this time:

    1. Uninstall the googleanalytics extension from the Extension Manager. As long as it is in the system, it inserts the new Google tracking code just above the closing </body> tag. This does NOT seem to be able to validate with Google Analytics since they require the new tracking code to appear immediately above the closing </head> tag.

    2. The only way I could this to work was to install the Google tracking code manually into the *.tpl template file(s) for the website that are in the "/templates directory. It works if the code appears immediately above the closing </head> tag and BELOW the closing php head call. Example:


    <?php echo $this->head; ?>


    <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'XX-XXXXXXXX-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>
    </head>

    3. I tried it above the closing PHP tag and that did not seem to validate with Google, and it did not validate if it was immediately above the closing </body> tag. As soon as I loaded the modifications to the templates above, the validation occurred immediately on login to Google Analytics. I suspect that the new code is validated differently than the previous UTM code which was required to appear immediately before the closing </body> tag.

    4. I believe (not sure about this though) that the validation requires that the site root have a page layout attached to it ( I used the default) and since this has the template attached, the code appears in the root.

    5. Hopefully the "googleanalytics" extension developer will update their wonderful extension to work with the new Google requirements.

    Anybody else running into this, or have a comment?

    Ernest McDermon
    Snellville, GA

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
  •