Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • ariane1001 Friend
    #186602

    Hi,

    I would like to insert my Google Analytics code in my template. I followed this post: http://www.joomlart.com/forums/topic/analytics-into-ja-mendozite/

    But I don’t see the analytics code, what is going wrong?
    Site url: http://welzijngo.nl/

    Ariane

    pavit Moderator
    #489296

    Hi

    Try to add your google analytics code before the </head> tag

    <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXXXX-XX']);
    _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>

    ariane1001 Friend
    #489333

    Hello,

    Tried that also. My code is different but that’s what I have got from the Google analytics website.

    Am I putting it in the right file? templates/ja_mendozite/page/default.php?

    Thanks

    max_santiago Friend
    #525130

    <em>@ariane1001 368247 wrote:</em><blockquote>Hello,

    Tried that also. My code is different but that’s what I have got from the Google analytics website.

    Am I putting it in the right file? templates/ja_mendozite/page/default.php?

    Thanks</blockquote>

    I have same Ariane question: is path ‘templates/ja_mendozite/page/default.php’ correct and into default.php we have to copy ‘Google Analytics Code’ before closed-tag ‘head’?!

    m.

    Ninja Lead Moderator
    #525267

    @ariane1001: Have you sorted it out at your end? I see your site is working fine now with google analytic script


    <script type="text/javascript">
    (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-39968602-1', 'welzijngo.nl');
    ga('send', 'pageview');

    </script>


    @max_santiago: You can follow steps below:

    Copy the default.php file in this plugins/system/jat3/jat3/base-themes/default/page/ path.

    Create “page” folder and paste the file above into, you should have:
    <blockquote>templates/ja_mendozite/page/default.php</blockquote>

    Then, open this default.php file and add google analytics below “</body>” or </head> tags

    Once done to clear cache from admin area.

Viewing 5 posts - 1 through 5 (of 5 total)

This topic contains 5 replies, has 4 voices, and was last updated by  Ninja Lead 10 years, 8 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum