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

5.7k Views Asked by At

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?

2

There are 2 best solutions below

0
On BEST ANSWER

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:

0
On

I actually had the opportunity to meet with some of the Authors of the WCAG 2.0 rules and regs. Great group of people.
When I asked them the question re: pixels, they replied as others above re: the alt="". However, they stated that the preferred way to do this is doing the following:

change role="presentation"
and
aria=hidden

These are their 'default' recommendations, however they stated that also updating the alt="" would be added protection to help screen readers acknowledge that the pixel/URL is strictly decorative and not to be read by screen readers.