Analytics tracking pixels normally ARE GIFs, specifically a 43 byte transparent 1x1 GIF.
But most “GIFs” are not GIFs but rather Mp4, mov, or webm or some other compressed file format. Actual GIFs are extremely wasteful of bandwidth and not hardware optimized. The name lives on though.
Are you asking why a GIF is used, or why the 43 bytes are needed?
I think a GIF is likely the smallest wide-supported resources format (force the browser request a URL to load a specific resource). The 43 bytes is the minimum size for a valid GIF, so the browser won't log an error loading the image and go through all load events.
But most “GIFs” are not GIFs but rather Mp4, mov, or webm or some other compressed file format. Actual GIFs are extremely wasteful of bandwidth and not hardware optimized. The name lives on though.