Paste analytics code into the image that will be launched when the image is displayed

Is it possible to pack analytic code inside an image and run this code when uploading the image to a web page?

The image will be inserted into the page through the file upload form field, for example, if I have to add an image to this question, where I do not have direct access to add HTML or JS to the page.

The goal is to track page views on pages that I don’t have access to any code, only the ability to upload an image.

Almost the same approach as the Trojan Horse, but without any malicious intent.

+8
pixel image-processing google-analytics steganography
source share
1 answer

Tracking pixels requires a specific structure and a specific server.

Therefore, I can’t imagine anything like a Trojan horse, but you can track image loading as an event.

Try something like this:

Client side with one appointment

<img src="" alt="Facebook is new god" id="fblogo"/> <script type="text/javascript"> window.onload = function () { var logo = document.getElementById('fblogo'); logo.onload = function () { ga('send', 'event', 'FB', 'Loaded'); }; logo.src = 'https://facebook.com/fb/logo.png'; }; </script> 

Measurement Protocol Method - Server Side

 https://www.google-analytics.com/collect ?v=1 // Protokol version &tid=UA-XXXX-Y // Property ID &cid=55568765456 // Client ID stored in database or random number &dh=forum.eu // referrer &dp=image78974.png // filename &t=event // send instruction &ni=1 // non inteaction flag &ec=Image // Event Category &ea=Load // Event Action &el=image78974.png // Event Label 
0
source share

All Articles