Google Analytics
Localize Google Analytics script
https://support.google.com/analytics/answer/1032389?hl=en
-
By the way this solution prevent adblock from blocking google analytics scripts
-
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 -->
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.
Complete Analytics Optimization Suite (CAOS) — WordPress Plugins
Wordpress plugins to integrate GA
Google Analytics Alternatives
7 Alerts To Monitor SEO Process Opportunities and Issues
Realtime stats
GA Real-time Alternatives:
-
Clicky is cheap and easily integrated via GTM. Simplest of them.
-
Real-time Customer Analytics - Woopra Analytics for eCommerce But it has chat and video talk with users! Working also with GTM.
-
I think they shifted to mobile market: Mixpanel | Mobile Analytics
Try to make GA real-time:
- opserv.io - realtime Google Analytics alerts send only to SMS but not in Serbia
- Not working really
Analytics Aggregator: Segment.io
The idea is great but execution is pointless - Segment.io
Segment & Slack integration?
Segment.io CEO on Setting Up Your Analytics for Growth
Create, edit, and share goals - Analytics Help Events as Goals in Google Analytics
Setup event-triggered notifications or alerts – Segment
Namestio sam Knowtify Relay, ali on šalje notifikaciju na svakih 10 minuta a ne trenutno.
Google Analytics Integration - Segment WordPress Plugin - Segment
Integrate segment.io with Slack
slack and segment.io - Google Search Slack API: Community Built Integrations | Slack lygav/php-slackbot: Simple, easy to use PHP package for sending messages to Slack. Send pretty, colourful messages with rich attachments quickly with this friendly API. jwenzler/Shooker: Slack WebHooks PHP Class
Segment doesn’t have real competitors. Similar to him are:
Forget Segment.io
I had a lot of problem in optimizing Segment for browser pagespeed. It is practically impossible as it dynamically loads both the Google and Yandex scripts, so none of methods can interecept it and localize those scripts.
Not sure why but it seems that Webvisor feature on Yandex don’t work at all with Segment.
And finally, as a conclusion: Forget about Segment!
It doesn’t reduce any round-trips; it even loads more scripts - Segment’s is an extra. Slack notification barely works and sincerely it’s much easier and reliable to do it directly from inside WP than via Segment.
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?
-
Google Analytics API in PHP erebusnz/gapi-google-analytics-php-interface Google Analytics API in PHP Or wanze/Google-Analytics-API-PHP: Simple class to query the Google Analytics API v3 with PHP or How to Use Google Analytics API with PHP Archives - SitePoint or Hello Analytics API: PHP quickstart for web applications | Analytics Management API | Google Developers
-
API Client Library for PHP (Beta) | Google Developers Google Client API with PHP - step by step tutorial with (some) screenshots | enarion.net Accessing Google Analytics with Google Client API and PHP tutorial | enarion.net
-
Incredible resource:Google Analytics Demos & Tools Hit Builder to construct and validate Measurement Protocol hits.
-
thomasbachem/php-ga is server-side Google Analytics PHP Client, no longer maintained as Google finally released an official server-side tracking API: Measurement Protocol.
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.