1.0.0 • Published 5 years ago

dead-pixel v1.0.0

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

dead-pixel

The most minimalistic analytics system I could imagine. Stores only page loads, no personal information. Tracks by loading a simulated dead pixel into your site. Check your stats at https://deadpixel-11ef1.firebaseapp.com//

Installation

At the most basic level you can just load the tracking pixel and style it.

<img src="https://deadpixel-11ef1.firebaseapp.com/pixel.png" />

I tend to use this snippet at the bottom of the document.

<script>
  ;(function() {
    'use strict'

    var pxl = document.createElement("img")
    pxl.style.width = '1px'
    pxl.style.height = '1px'
    pxl.style.background = 'black'
    pxl.style.position = 'fixed'
    pxl.style.left = '99.7%'
    pxl.style.top = '0.3%'
    pxl.style.zIndex = '999999999'
    pxl.src = 'https://deadpixel-11ef1.firebaseapp.com/pixel.png'

    document.body.appendChild(pxl)
   })()
</script>

The world is your oyster.