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

2

13

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?

Relative answered 3/11, 2016 at 19:35 Comment(0)
D
18

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:

Denitrify answered 3/11, 2016 at 21:47 Comment(0)
R
7

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.

Relative answered 31/3, 2017 at 17:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.