editing out Google Analytics from java script

bburnett

Joined: 2008-09-03
Posts: 77
Posted: Sat, 2012-08-25 04:25

Can I edit out the Google Analytics code from the java script? I mean doesn't Google harvest enough information already? (sorry Bharat but I would like to remove this)

Thanks, Peace
bburnett

Platform Information:
Host name: box443.bluehost.com = www.thebucketdatabase.com/videos
Operating system: Linux 2.6.32-20120131.55.1.bh6.x86_64
Apache: Unknown
PHP: 5.2.17
MySQL: 5.1.63-community-log
Server load: 35.9 28.01 27.41
Graphics toolkit: imagemagick

Gallery stats:
Version: 3.0.4 (Ricochet)
Albums: 5
Photos: 13

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2012-08-26 06:00

Disable the google analytics module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Sun, 2012-08-26 06:50
floridave wrote:
Disable the google analytics module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

There is no Google Analytics module. It's built into the core of G3's java script.

Google Analytics is implemented by including what is known as a "page tag". This is referred to as the Google Analytics Tracking Code (GATC) and is a snippet of JavaScript code that the user adds onto every page of his or her website. If JavaScript is enabled in the client browser then the GATC code collects visitor data and sends it to a Google data collection server as part of a request for a web beacon.

To function, the GATC loads a larger Javascript file from the Google webserver and then sets variables with the user's account number. The larger file (currently known as ga.js) is typically 18 KB in size and if caching is enabled in the client browser then ga.js is only downloaded once at the start of the visit as it will be cached throughout the session. As all websites that implement GA with the ga.js code are using the same master file from Google, a visitor that has previously visited any other website with this code implemented, will also have the file cached on their machine. The result is that the page overhead of including the GATC on web pages is kept to a minimum.

If cookies are enabled on the client browser then in addition to transmitting information to a Google server, the GATC sets first party cookies on each visitor's computer. This is used to store anonymous information such as whether the visitor has been to the site before (new or returning visitor), what is the timestamp of the current visit and what was the referrer site or campaign the visitor came from e.g. search engine, keywords, banner or email.

bburnett
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sun, 2012-08-26 17:47

@bburnett: Nope, Gallery doesn't auto-include Google Analytics. I can confirm that there isn't a "ga.js" file loaded when visiting my Gallery install. Maybe it's a "feature" of Google's Chrome browser (if you're using that)?

I do know that some third-party scripts (e.g. Lockerz Share--which used to be called AddToAny) automatically add Google Analytics (without asking) so check your third-party scripts and add-ins.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2012-08-26 18:50
Quote:
It's built into the core of G3's java script.

Please show the code. I don't see any reference it it at all.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Mon, 2012-08-27 05:06

I don't use Chrome and it must be built into the Pear theme. Trust me, its transmitting data back to Google.

The latest version of Google Analytics tracking code is known as the asynchronous tracking code,[12] which Google claims, is significantly more sensitive and accurate, and is able to track even very short activities on the website. The previous version delayed page loading and so, for performance reasons, it was generally placed just before the </body> body close HTML tag. The new code can be placed between the <head>...</head> HTML head tags because, once triggered, it runs in parallel with page loading.

In April 2011, Google announced the availability of a new version of Google Analytics, featuring multiple dashboards, more options of custom reports and a new interface design.[13] This version was later updated with some other features such as real-time analytics and goal flow charts.[14][15]

bburnett
https://disconnect.me/about
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2012-08-27 05:26
floridave wrote:
Please show the code. I don't see any reference it it at all.

Let us know if it is in the Pear theme. Can you confirm?[2]
What do you want us to do about it if it is indeed the 3rd party theme?[3]

What is the text you quoted about?[1]

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

*[1,2,3] Questions asked. :-)

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Mon, 2012-08-27 13:08
bburnett wrote:
it must be built into the Pear theme

Built into a theme is different from built into Gallery; those are totally different statements.

Back up everything, open the theme's page.html.php file, look for these lines, then delete them or comment them out:

		<!-- Google analytics code -->
		<script type="text/javascript">
			var _gaq = _gaq || [];
			_gaq.push(['_setAccount', '<? $account = module::get_var("th_pear4gallery3", "ga_code"); if ((!isset($account)) or ($account == "")) print "UA-23621420-1"; else print $account;?>']);
			_gaq.push(['_setDomainName', 'none']);
			_gaq.push(['_setAllowLinker', true]);
			_gaq.push(['_trackPageview']);
			(function() {
			 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
			 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
			 })();
		</script>

There may be unintended consequences, but I doubt it.

 
musikpirat

Joined: 2010-06-14
Posts: 2
Posted: Sun, 2012-09-02 19:49

This totally sucks... I am using a gallery on my own webserver to prevent user's data from being leaked to google and other sites and a theme breaks my "policy".

The pear theme should be banned from any official gallery site for this behaviour!

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2013-09-30 00:25

FYI - I just pulled a change into gallery3-contrib's pear4gallery3 theme to disable Google Analytics by default. Community themes are created and maintained by the community - if you want them to be different, go ahead and change them. There's no policy here around this and Google isn't trying to sneak code into your system, etc.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!