I'm building an website with Open Web Analytics.
My host is an free host and automatically insert Google Analytics.
I want remove Google Analytics because it forces to track users.
I inserted jQuery based node remove code before ga but it still gets loaded.
Like this:
<!-- Remove Google Anaylitics and include OWA. -->
<script src="js/RemoveGA.js"></script>
<script src="js/OWA.js"></script>
//RemoveGA.js
$(document).ready(function () {
$("script").each(function () {
if (this.innerHTML.length > 0) {
var googleScriptRegExp = new RegExp("var gaJsHost|var pageTracker");
if (this.innerHTML.match(googleScriptRegExp) && this.innerHTML.indexOf("innerHTML") == -1)
$(this).remove();
}
});
});
Is there any solution to achieve this?
I'm building an website with Open Web Analytics.
My host is an free host and automatically insert Google Analytics.
I want remove Google Analytics because it forces to track users.
I inserted jQuery based node remove code before ga but it still gets loaded.
Like this:
<!-- Remove Google Anaylitics and include OWA. -->
<script src="js/RemoveGA.js"></script>
<script src="js/OWA.js"></script>
//RemoveGA.js
$(document).ready(function () {
$("script").each(function () {
if (this.innerHTML.length > 0) {
var googleScriptRegExp = new RegExp("var gaJsHost|var pageTracker");
if (this.innerHTML.match(googleScriptRegExp) && this.innerHTML.indexOf("innerHTML") == -1)
$(this).remove();
}
});
});
Is there any solution to achieve this?
Share Improve this question edited Nov 4, 2018 at 2:51 Tatsuyuki Ishi asked Dec 2, 2013 at 8:38 Tatsuyuki IshiTatsuyuki Ishi 4,0414 gold badges30 silver badges42 bronze badges 2- 4 Best solution: switch hosts. (It's likely that the TOS prevents you from messing with their GA code.) – JJJ Commented Dec 2, 2013 at 8:56
- Check out why your hosts integrate Analytics, maybe they want to provide analytics data to you, not for themselves - which would not be all that different from using owa. Plus you could place a link to the opt-out tool prominently on your homepage (tools.google./dlpage/gaoptout). All in all I'd agree with Juahana that switching hosts is the best option. – Eike Pierstorff Commented Dec 2, 2013 at 10:00
1 Answer
Reset to default 5You can disable their Google Analytics account from tracking your website by defining the following global variable:
window['ga-disable-UA-XXXXXX-Y'] = true;
Change UA-XXXXXX-Y for the Account number they use.
Source: https://developers.google./analytics/devguides/collection/gajs/#disable