This is a repository with demo application code for my Medium article "Save Your Analytics from Content Blockers".
You can use modified analytics script directly from GitHub pages (until it appears in ad-blockers filters 😄):
<script>
(function(i,s,o,r){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date()})(window,document,'script','ga');
ga('create', 'UA-12345678-1', 'auto'); // replace this tracking code with your one
ga('send', 'pageview');
</script>
<script src="https://zitros.github.io/save-analytics-from-content-blockers/analytics.js" async></script>
Having the latest NodeJS and NPM installed, run the server with the following command:
npm install
npm run start
Then go to the printed link. To explore the example completely, you need static IP address at least.