Jump to:

5541 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Add Google Analytics on Page Comment post

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

Page: 1
Go to End
Author Topic: 764 Views
  • MarijnKampf
    Community Member
    164 Posts

    Add Google Analytics on Page Comment post Link to this post

    I would like to track addition of page comments in Google Analytics. I hoped it would be easy to do this by extending the PageComment class onAfterWrite function. However, I can't find a way to include the Google Analytics JS and get it executed.


    class PageCommentGoogleAnalytics extends DataObjectDecorator {
    function onAfterWrite() {
       return $this->owner->renderWith("PageCommentGoogleAnalyticsWrite");



    Anyone any tips on how to track posting of comments in Google Analytics?

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.