Jump to:

1845 Posts in 1601 Topics by 560 members

Blog Module

SilverStripe Forums » Blog Module » Google Analytics on the Blog Module?

Discuss the Blog Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 563 Views
  • Larry7
    Avatar
    Community Member
    21 Posts

    Google Analytics on the Blog Module? Link to this post

    I would like to put GA on the Blog module. So far I thought for other pages I could just modify page.ss and add the code there but as a SS neophyte, when looking at how Blog works, I couldn't see which template I should update or if indeed Blog does use the page.ss template. If it does, then I could just stick the code in this section

    <div id="footer">
    <div id="footer-valid">
    <% include Footer %>

    [ put blog code here]
    </div>
    </div>
    </div>
    </body>
    </html>

    The code I want to put in looks like this

    <script type="text/javascript">

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

    Should this work?

    Thanks

    563 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.