Google Analytics Measurement Protocol Returned Gif
Asked Answered
N

1

7

I'm using the GA measurement protocol, and it's returning a gif file.

I'm a little unclear what this file is for - ideally I'd like to be able to send measurement protocol requests as fire and forgets to keep page load times at a minimum.

Is it important to render this gif on the page?

Nones answered 27/4, 2017 at 14:24 Comment(8)
But if you are on the page, why are you sending hit using Measurement Protocol ?Babylon
@Tushar will capture 100% of visitors, we're losing ~30% due to adblockers.Nones
I dont think so you will lose any traffic due to ad blocks... I am working with some of the biggest publishers across the world, and I would never recommend measurement protocol...no one lost traffic because of ad block. Please describe your problem statement why you think ad block is making your traffic to loseBabylon
@Tushar adblockers block Google Analytics, that's a pretty easily verifiable fact. Different between Google Analytics Traffic and Cloudflare reported traffic is ~30%.Nones
No, who so ever told you that Ad blocker blocks ga, its so not true. Only ads tags like floodlight get blocked by ad blocker. just open you stack overflow, inspect element-->network--> filter with collect. Put the ad blocker on and refresh...you will see the GA still getting fired ;) If ad blocker would have stopped GA, I would have been in stealth mode ;0Babylon
I am sure these are some kinds of bots as the GA filters them. CloudFlare tracks all of your traffic by requests, so your CloudFlare visitor number is most likely higher.Babylon
quantable.com/analytics/how-many-users-block-google-analytics Says here that uBlock Origin, Purify, Adblock Browser all block by default. Secondly, if you have JS disabled like some popular privacy plugins do, GA wont run. CF is higher because it includes bots, people with JS disabled, and people with Adblockers.Nones
Let us continue this discussion in chat.Babylon
B
9

That's simply a design decision by Google - calls to the GA endpoint return a 200 http status and a 1x1 transparent gif (regardless if your payload data is valid or not, so don't use that to ascertain if your hit has been recorded).

I presume a http 204 not content would have worked as well, but at least with the gif image you can stick you measurement protocol call into an image tag (as a tried and tested way to transmit data over domain boundaries from your domain to Google).

The browser needs to receive it know that the request is complete, but you do not need to render it.

Bellini answered 27/4, 2017 at 15:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.