Google Analytics Measurement Protocol Returned Gif

I am using GA measurement protocol and returning a gif file.

I am a bit confused about what this file is for - ideally I would like to send requests for measurement protocols like fire and forget to keep the page load time to a minimum.

Is it important to display this gif on the page?

+3


source to share


1 answer


This is just a design decision from Google - calls to the GA endpoint return 200 http status and a transparent gif 1x1 (regardless of whether your payload data is valid or not, so don't use that to find out if your hit was recorded).

I assume http 204 won't work content, but at least with a gif image you can bind a measurement protocol call to the image tag (as a tried and tested way of transferring data across domain boundaries from your domain to Google).



The browser needs to get it to know that the request is complete, but you don't need to display it.

+3


source







All Articles