ELI5: Google Analytics. How does it work and what is the information used for?
Is Google analytics worth it? How does it compare to other bootcamps?
ELI5: Google Analytics
First you set up an account for Google Analytics. You give your name, your domain (your website address), your emails, and whatever else.
Analytics then gives you some code. All you have to do is copy this code (it's pretty short) onto the beginning of your website, in your "header" which is typically loaded at the beginning of every page. If you like, you could load it only on certain pages.
When someone goes to your website, your browser downloads the entire page like usual, including the Analytics code.
What the Analytics code actually does is simply record things that your browser tells the web pages anyway. Things like location (country, city), language, browser (Internet Explorer, Firefox, Chrome, etc), operating system (Windows, Mac OSX, etc), screen resolution, and many other things that browsers always tell every website they go to. This info is required for the web to function correctly. All Analytics does is record it and present it to you with graphs and charts.
Edit: here is what the actual code looks like. It's in a language called JavaScript.
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '**********']);
_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);
})();I censored the account number, though (line 2). This code "includes" code that is hosted (saved on) the Google servers. So, every time you visit the page, the browser comes across this, reads the code on the Google servers (really quickly, of course) where Google records the info, then finishes loading the page.
More on reddit.com