Google Analytics (ga)
About
What is a Analytics Application? from Google
ga() is tracking snippet. It's implemented as a javascript global function known as the command queue
Error handling
If the ga() command queue receives a command it doesn't recognize, it simply ignores it, making calls to the ga() function very safe, as they will almost never result in an error.
Management
Create a tracker
Client Id
If a cookie does not exist for the specified domain, a client ID is generated and stored in the cookie
Command
https://developers.google.com/analytics/devguides/collection/analyticsjs/command-queue-reference
Test / Debugging
- Google Tag Assistant is a Chrome Extension that helps you validate the tracking code on your website and troubleshoot common problems. It's an ideal tool for debugging and testing your analytics.js implementations locally and ensuring everything is correct before deploying your code to production.
Plugin
- Autotrack Plugin with outboundLinkTracker - Automatically tracks link clicks to external domains.
Structure
In google analytics, an Organization has several account:
- that have several Properties (web site)
- that may be composed of several Views
When you associate a site with a property, clicking a link to Google Analytics from Search Console will take you to that property’s default view.
Hierarchy of organizations, accounts, users, properties, and views