Tutorial by Examples

Add the following code (known as the "JavaScript tracking snippet") to your site's templates. The code should be added before the closing tag, and the string 'UA-XXXXX-Y' should be replaced with the property ID (also called the "tracking ID") of the Google Analytics property yo...
Google Analytics is used to track user activity on your website or mobile application. To set up google-analytics on a website you will need to get a snippet of JavaScript code from Google that you embed in the head of each page on your site that you want to track user activity. Get the code snipp...
To track so called "virtual pageviews", use the ga('send') method right after your asynchronous request: Syntax: ga('send', 'pageview', 'path to your virtual page'); Example (Simple Link): <a href="http://example.com/my.pdf" onClick="ga('send', 'pageview', '/virtu...
While the JavaScript tracking snippet described above ensures the script will be loaded and executed asynchronously on all browsers, it has the disadvantage of not allowing modern browsers to preload the script. The alternative async tracking snippet below adds support for preloading, which will pr...
Plugins are scripts that enhance the functionality of analytics.js to aid in measuring user interaction. Plugins are typically specific to a set of features that may not be required by all Google Analytics users, such as ecommerce or cross-domain tracking, and are therefore not included in analytics...
When you add either of these tracking snippets to your website, you send a pageview for each page your users visit. Google Analytics processes this data and can infer a great deal of information including: The total time a user spends on your site. The time a user spends on each page and in what o...
Getting a GA Account: If you don’t have an Analytics account, create one. If you do have an Analytics account, sign in. Both options are available at google.com/analytics Setting up a property in your Analytics account: A property represents your website or app where the data gets aggrega...

Page 1 of 1