Question Details

No question body available.

Tags

reactjs next.js

Answers (4)

March 16, 2026 Score: 0 Rep: 4,314 Quality: Low Completeness: 60%

I have done impression tracking with frontend & backend code I wrote myself. It is not worth the effort to code it yourself, unless you have a hard requirement to do so.

If you are fine with a bare minimum way to just track impressions, create a transparent 1x1 gif or png with a unique URL. The image should be served without caching.
You could even configure your server to make the 404 return that png for all URLs within /t/ for example, so adding to your HTML would track the impression of your homepage, /t/about-us/contact.png for the contact form or whatever you got to track impressions of. In your case, for example /t/posts/20716.png (

March 16, 2026 Score: 0 Rep: 160,576 Quality: Low Completeness: 0%

I thought the OP explicitly asked for on-screen tracking, not fetches, though? So “search for one that works” is the summary?

March 16, 2026 Score: 0 Rep: 4,314 Quality: Low Completeness: 20%

They asked for "track impression only when it appear on the user screen" - that's what the transparent gif would be for. If the website appears on the screen, request that transparent png, count requests server-side.

I didn't understand this as eye-tracking. Just counting impressions.

I have worked with this and many clients aren't too happy about the reporting and counting impressions being very limited, so I added the part about existing website tracking tools in case OP is not aware. But they can tell me that themselves if they want to.

March 16, 2026 Score: 0 Rep: 31 Quality: Low Completeness: 10%

We are using infinite scroll for feed page, on page load suppose we are fetching 20 posts initially, impression for each post will need to be tracked only when user scroll down and post appears on a browser viewport.