Excluding CMS pages from Google Analytics?

Posted by Community Admin on 03-Aug-2018 07:18

Excluding CMS pages from Google Analytics?

All Replies

Posted by Community Admin on 10-Aug-2012 00:00

Hi all,

I was wondering what approach anyone else uses (if any) to exclude Sitefinity backend pages+functions from affecting your Google Analytics pageviews. What I mean is - when you are editing or previewing a page in the backend, it will still load your GA code in your template, and count as a pageview. Ideally, this wouldn't happen, because it's not *really* traffic that we want to track, as we just want real visitors tracked.

It would be good if when using the Analytics widget, it would give you the option to NOT render the GA snippet if the page is in any kind of CMS mode (editing, previewing, etc). Would there be a way to configure template settings for that widget to not render in CMS mode?

Alternatively, there is the approach which I've used in the past, which is to do it as a filter in Google Analytics, and basically exclude all pages that end in /Action/Edit or /Action/Preview, etc... can anyone suggest a more comprehensive list of similar URLs to filter out?

Interested to get some input on this! :)

Posted by Community Admin on 18-Feb-2013 00:00

I would also like some input on this?  Anyone have any ideas?

Posted by Community Admin on 19-Feb-2013 00:00

Hello Matt,

For the purpose use a master page to create template, I have used Clan.master template and its code behind  don`t render the first content placeholder where you will put the JavaScript widget with GA code (the problem is in the _gaq variable):

protected void Page_Load(object sender, EventArgs e)
        
            if (Page.IsDesignMode() == true)
            
                this.ContentPlaceHolder1.Visible = false;
            
        

Make sure to add one more content placeholder to the master page:

<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
          
        </asp:ContentPlaceHolder>
           <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
          
        </asp:ContentPlaceHolder>


To have placeholder for dragging another widgets. The placeholder where the GA code is used will not be rendered when page is in Edit mode.

All the best,
Stefani Tacheva
the Telerik team

This thread is closed