htmlaccessibilityaltwcag2.0tracking-pixel

Do tracking pixels need to have alt attributes for accessibility (WCAG 2.0)?


We are running a website and have 3rd party tracking pixels, but we're receiving alt attribute errors when doing a webaim/WCAG 2.0 scan on our site.

I'm not sure if in this situation the tracking pixels actually need to still have a blank alt attribute or would some screen readers still read the src?


Solution

  • alt="" is the most appropriate approach in this case - this tells the screenreader that the image is purely decorative and should be ignored. Since tracking pixels do not visually convey information, they are essentially decorative from this point of view.

    If no ALT is present, some screenreaders will fallback to reading the image name (without extension) instead, which you generally don't want.

    Some screenreaders (JAWS) may ignore 1x1 or similarly sized small images - but still best to put alt="" as that's the best practice.

    Some references: