Hidden pixel

Understanding the user through every click
April 28, 2024 by
Hidden pixel
REDSYSTEM, Giannino Cuignet

In this article, I explain how to create your own hidden pixel solution without external infrastructure using Cloudflare.


To get started, go to Cloudflare to create a "Worker Page". Here is an example of the code you could integrate there:



https://raw.githubusercontent.com/ZetterSploit/pixelsploit/main/worker.js

This code generates a white pixel on a webpage while capturing data such as IP and user agent. With Cloudflare Workers KV, you can see the output below.




pixelsploit
is the name of the namespace used here and in the code above.


To link your worker to this KV space, go to Workers & Pages > Settings > Variables > KV Namespace Bindings.


In this example, any URL containing a valid MD5 (eg. https://exemple.com/<md5>) will be recorded in your KV space, allowing you to retrieve and store visitor data.


Integration of an email is done as follows :

<img src="https://exemple.com/<md5>" width="1" height="1" alt="Pixel de Suivi" style="display:none;">

Share this post