Exclude google analytics on confluence space

Ravikanth Masanala June 16, 2014

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

1 vote
Guilherme Nedel [Atlassian]
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 19, 2014

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 at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 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;
    }

0 votes
Ravikanth Masanala June 23, 2014

Thank you Both,

May I Know where i have to add this code?

Regards,

Ravikanth

Guilherme Nedel [Atlassian]
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 24, 2014

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

Ravikanth Masanala June 24, 2014

Hi Guilherme,

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

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 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
TAGS
AUG Leaders

Atlassian Community Events