Prefetch websites counting as a hit?

Enjoying Matomo.

As many know today’s browsers in mobile phones and elsewhere allow for pre-fectching web pages.

I presume this means that even if a user does not willingly visit a site, as long as that site is on their bookmarks or cookies or whatever, Matomo may log a “hit” from that user, even though they may have not knowingly clicked on that site as a destination - the prefetching is making it look like a hit…

Can anyone weigh in on this theory?

Thank you.

Do you know if JavaScript is executed in pre-fetching?
Also if images are loaded?

I don’t know. Do you mean does the website that shows a hit have images and JavaScript that are supposed to load?

If you use a pixel image to track the page view and if the prefetch loads the images, then you’ll have a hit in Matomo.

The same, if the prefetch runs JavaScript (IMO, it would be too heavy for the browser…), then the prefetch will create a hit in Matomo…

Thank you Philippe for that useful information.

I’m using the Matomo generated javascript code.

Would you know if Tag Manager tracking also uses javascript and/or would it be a better way to track if users’ mobile phones are using pre-fetching?

MTM uses also JavaScript, so the impact would be the same as Matomo generated JavaScript code.

I think you can try to create a page (URL-1 - that you are sure Google won’t crawl) with one image (URL-2) and some JavaScript that sends an HTTP request to an URL-3…
Then use the prefetch of your mobile browser, and check on the server log if URL-1, URL-2 and URL-3 are hit or not…
If you don’t have an access to the server log, try do it with Matomo (still on pages that people and Google won’t know in order to not pollute your test)… :wink:

Currently, I can’t do such tests on my side…

Thank you Philippe - I will try to get that done and report back.

I do have full access to server logs and am wondering - when prefetching is in use doesn’t the visitor’s device send some special headers or something that I should be able to view in the logs? That could be another way to figure this out, no?

I have no idea… :thinking:
IMO, it should use the same headers as the browser would if you really browse the page…