Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
74
rated 0 times [  80] [ 6]  / answers: 1 / hits: 5580  / 11 Years ago, mon, december 2, 2013, 12:00:00

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?


More From » jquery

 Answers
0

You 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.com/analytics/devguides/collection/gajs/#disable


[#49930] Saturday, November 30, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
georginat

Total Points: 656
Total Questions: 107
Total Answers: 108

Location: South Georgia
Member since Fri, Nov 13, 2020
4 Years ago
;