Google Analytics

Google Analytics

Localize Google Analytics script

https://support.google.com/analytics/answer/1032389?hl=en

http://stackoverflow.com/questions/29162881/pagespeed-insights-99-100-because-of-google-analytics-how-can-i-cache-ga

  1. By the way this solution prevent adblock from blocking google analytics scripts

  2. nije ni veliki - 26K

<!-- Google Analytics -->

<script async id="linkidjs" src="//www.google-analytics.com/plugins/ua/linkid.js">/* prevent inlining */</script>

<script>
  window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;

  // Create a default tracker with automatic cookie domain configuration
  ga('create', 'UA-70616275-1', 'auto');

  // Enable Enhanced Link Attribution. 3rd parameter is very important
  ga('require', 'linkid', document.getElementById("linkidjs").src);

  ga('set', 'anonymizeIP', true);
  ga('set', 'forceSSL', true);

  ga(function(tracker) {

    // Set value for custom dimension at 1st index
    ga('set', 'dimension1', tracker.get('clientId')); 

    // Send a pageview hit from the tracker
    ga('send', 'pageview');
  });

</script>

<script async src='//www.google-analytics.com/analytics.js'></script>

<!-- End Google Analytics -->

Conversion Tracking

AdWords Conversion Tracking Setting up conversion tracking

Google Tag Manager

Classic GA vs. Universal Analytics

The Classic Google Analytics tracking code is named ga.js and the new Google Analytics Universal Analytics tracking code is analytics.js. Migrating to Google Analytics Universal Analytics is not a question of if but when.

GA Analytics Scipt Plugins from 2015

Scroll Depth - A Google Analytics plugin for measuring page scrolling Riveted - A Google Analytics plugin for measuring active time on site Screentime - Measure how much time things spend on-screen


JavaScript Tracking Snippet Reference  |  Analytics for Web (analytics.js)  |  Google Developers

google analytics - Relative URL path for linkid.js - Stack Overflow


!!! For the most accurate link attribution, each of the links on your page should have a unique element ID.


Goals in Google Analytics

How to Setup a Goal in Google Analytics How to Track Downloads & Outbound Links in Google Analytics | Digital Analytics & Marketing Blog

Google Analytics Setup and Configuration Tool

Server-side Google Analytics?


Subdomain Tracking in GA

Common uses for cross-domain measurement - Analytics Help Subdomain Tracking with Google Analytics

Subdomains

You can use cross-domain measurement to collect data from a primary domain, like www.example.com, and a subdomain, like www.subdomain.example.com, in a single Analytics account property. No additional configuration is required.

Also Update Your Referral Exclusion List https://www.bounteous.com/insights/2016/08/11/two-steps-correctly-tracking-subdomains-google-analytics/

Subdomain in GA4

Yes, and you DON’T need cross-domain tracking for that.

If you want to track different websites that belong to the same domain (e.g. blog.yourwebsite.com and www.yourwebsite.com), Google Analytics 4 will handle that automatically.

Cross-domain tracking in Google Analytics 4

date 21. Dec 2016 | modified 10. Jun 2024
filename: Web » Analytics » Google Analytics