Exclude google analytics on confluence space

Hello Team,

Currently we have setup google analytics for our confluence site. One of our space admin requested us to remove the monitoring on their space as they have sensitive information posted on space and does not want to monitor by any third party tool. Is it possible to remove the monitor on a particular space? If you have any script please let us know.

2 answers

Hello Ravikanth, though this appears to a bit external to Confluence functioning itself I did find this thread in a third party forum, which may be of help:

To disable tracking, set the following window property to true:

window['ga-disable-UA-XXXXXX-Y'] = true;
Where the value UA-XXXXXX-Y corresponds to the web property ID on which you would like to disable tracking.

This window property must be set before the tracking code is called. This property must be set on each page where you want to disable Google Analytics tracking. If the property is not set or set to false then the tracking will work as usual.

So, for example, if your Google Analytics tracking code on a page includes:

_gaq.push['_setAccount', 'UA-123456-1']
And you would like to disable that tracking code from setting cookies or sending data back to Google Analytics, then you use the following code before the tracking code is called:

window['ga-disable-UA-123456-1'] = true;
If you use multiple trackers on a page with multiple web property IDs, you must set the equivalent window['ga-disable-UA-XXXXXX-Y'] variable to true for each web property to completely disable Google Analytics tracking on that page.

David Simpson Community Champion Jun 23, 2014

This is correct. I use the same approach to remove other people's trackers e.g.

// Disable any trackers that Atlassian may have added
    for (i=0; i < 50; i++) {  // normally it's 14 for OnDemand, but let's use a hammer to kill any new ones too.
        window['ga-disable-UA-20272869-'+i] = true;
    }

Thank you Both,

May I Know where i have to add this code?

Regards,

Ravikanth

Hi Ravinkath, you can add that just at the head ending within: Browse > Confluence Admin > Look and Feel - Custom HTML > Edit

Hi Guilherme,

If I apply this script it will be applied to all spaces right?

David Simpson Community Champion Jun 25, 2014

Yes, it will apply to all spaces. When pasting into Browse > Confluence Admin > Look and Feel - Custom HTML > Edit -- Make sure that you wrap the code above in some script tags like so:

<script>
// Disable any trackers that Atlassian may have added
for (i=0; i < 50; i++) {  // normally it's 14 for OnDemand, but let's use a hammer to kill any new ones too.
    window['ga-disable-UA-20272869-'+i] = true;
}
</script>

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 11, 2018 in Confluence

What are your project planning tips?

Hello Community,  Jessica here from the Confluence product marketing team! Today I wanted to get your takes on project planning –– what works, what doesn’t, how do you know if you’re doing it r...

260 views 1 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you