Skip to content

jszczypk/save-analytics-from-content-blockers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Save Analytics From Content Blockers

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>

Running the Example

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.

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 63.3%
  • HTML 36.7%