Giter Club home page Giter Club logo

pixel-ping's Introduction

Pixel-Ping

A basic WordPress plugin to capture basic Page Views in a privacy-forward way.

Overview

This is intended as a light-weight pixel tracker. Its not that light-weight in that it requires WordPress but you can't have everything. The image it loads is about 260 bytes in size fr the network request and payload.

It relies on WP's transients and minimizes reads/write to the filesystem.

Aggregate event data is saved in JSON files that are broken down by year and month. Periodically a background function runs to aggregate them into a CSV.

While the original use-case is to track values like a URL, it can be used with anything as they key.

Usage

This is intended as a light-weight pixel tracker. Its not that light-weight in that it requires WordPress but you can't have everything.

It relies on WP's transients and minimizes reads/write to the filesystem.

Aggregate event data is saved in JSON files that are broken down by year and month. Periodically a background function runs to aggregate them into a CSV.

After activating the plugin, you will not be able to load a small transparent 1x1 PNG image on your domain:

https://example.com/pixel.png

This in itself will not do anything.

Add this as the SRC for an IMAGE and append the URL of the page you want to track.

Example:

https://example.com/pixel.png?u=https://something.example.com/hello.html

So...

<img src="https://example.com/pixel.png?u=https://something.example.com/hello.html"/>

As image is loaded a counter is incremented. This is stored in WordPress's transient cache. It is written to the filesystem after subsequent calls to minimize read/writes. A cron job is scheduled to ensure that counts are not lost of you are experience low traffic.

Data

Data is saved long-term in JSON files that correspond to the year and month of the event. As data is stored temporarily in cache, these numbers can lag the actual figures by minutes or a day depending on site traffic volume.

Data also includes the referring domain if available.

Privacy

This does not track, collect, or store any personal information. It accepts a key, trackes the number of calls against it in aggergate, and the referring domain. Thats pretty much it. No last four digits of your SSN required.

pixel-ping's People

Contributors

donohoe avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.