LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 07-13-2017, 06:09 AM   #1
laconiclizard
LQ Newbie
 
Registered: Feb 2016
Posts: 6

Rep: Reputation: Disabled
where does javascript happen?


Uh, if a website has a standard google analytics script in it, where does that actually happen? I mean the webpage just spits out html code and your browser interprets it, right? So it's the individual browsers that execute those scripts and communicate with google analytics, right? Not the webpage? I'm not a programmer.
 
Old 07-13-2017, 06:15 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,306
Blog Entries: 3

Rep: Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720
Quote:
Originally Posted by laconiclizard View Post
Uh, if a website has a standard google analytics script in it, where does that actually happen? I mean the webpage just spits out html code and your browser interprets it, right? So it's the individual browsers that execute those scripts and communicate with google analytics, right? Not the webpage? I'm not a programmer.
Welcome.

Yes, the inividual browsers execute the scripts. The scripts then might take further communication with Google Analytics or other sites, I haven't bothered to read them and let NoScript or ScriptBlock do the work.

The script in that context is run on your machine inside your browser, if you have allowed it to happen. Regardless of whether the script is run or not, the mere act of fetching it via HTTP or HTTPS allows the source site to observe that you have visited if they wish to track such things. When combined with cookies and / or web bugs (such as the FB "Like" button) and / or browser fingerprints, an individual user can be tracked and profiled in great detail.
 
Old 07-13-2017, 06:25 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,306
Blog Entries: 3

Rep: Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720
If you want to see what the page is pulling in and what load it puts on your connnection, you can do that easily in Firefox or Chromium using the "Inspect Element" function. Either right-click on the page and choose "Inspect" or "Inspect Element" or press ctrl-shift-i for the same result. That will pull up an information panel and one of the tabs is "Network". Select that and then reload the page. It will show you what (unnecessary) pieces are being pulled, from where they are coming, and how long they took to get into your browser.
 
Old 07-13-2017, 06:36 AM   #4
laconiclizard
LQ Newbie
 
Registered: Feb 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Then couldn't we copy the google analytics script from a website and put in on other websites? I mean if that scripts is executed on people's personal browsers and not at www.whatever.com, then couldn't any website send out an identical script with the same ID number or whatever and google analytics wouldn't know the difference?
 
Old 07-13-2017, 08:00 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
You could just "sell your web-browser statistics data to Google," if they wanted it, but they actually want to spy on your end-user, to learn his IP-address and so on. So, Google Analytics consists of encoded JavaScript programming which will be executed by the end-user's browser.
 
Old 07-13-2017, 10:35 AM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by laconiclizard View Post
Then couldn't we copy the google analytics script from a website and put in on other websites? I mean if that scripts is executed on people's personal browsers and not at www.whatever.com, then couldn't any website send out an identical script with the same ID number or whatever and google analytics wouldn't know the difference?
I don't know Google Analytics well, but I did find this question interesting enough to google (yeah I know...) Here's a story about a site being caught doing that.

https://websanova.com/blog/articles/...acking-mlb-com
https://news.ycombinator.com/item?id=7477736

Last edited by dugan; 07-13-2017 at 10:37 AM.
 
Old 07-13-2017, 02:25 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
Google Analytics, of course, uses a key ("nonce") system to uniquely identify their data streams. If you simply copied an analytics package, it wouldn't be yours.
 
Old 07-14-2017, 01:24 PM   #8
Trihexagonal
Member
 
Registered: Jul 2017
Posts: 362
Blog Entries: 1

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
Quote:
Originally Posted by Turbocapitalist View Post
I haven't bothered to read them and let NoScript or ScriptBlock do the work.
NoScript is the first browser extension I install when I build Firefox and wouldn't leave 127.0.0.1 without it, except to get it.

I'm dead set against running JavaScript globally and very picky about where and what scripts I do allow to run.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: JavaScript creator Eich's latest project: KILL JAVASCRIPT LXer Syndicated Linux News 0 06-18-2015 08:30 AM
[SOLVED] What I would like to happen Don Graham Linux - General 14 01-25-2015 03:18 PM
Looking for Textbrowser with JavaScript Support or Elink Javascript Support rohezal Linux - Software 4 09-01-2009 01:02 PM
Ubuntu Edgy/Firefox 2/Javascript - Firefox closes accessing websites with Javascript Interdictor Ubuntu 8 11-02-2006 11:58 AM
What would happen????? edlentz Linux - Software 1 10-17-2005 11:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 04:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration