3

I work at a company with a very prolific tracking tag, which uses a tracking pixel to pass information. Currently, our tag uses a bare <img> inside of a <noscript>, and the image does not have an alt attribute.

Our SEO wants to add an alt with some keywords to the tracking pixel, but I noted that the Facebook and Google pixels do not do this. I'm unable to justify my resistance to making this change besides a strong gut-feeling and comparison to competitors.

Is there any technical or SEO reason why this would be a bad idea? Have Facebook and Google simply overlooked this, or perhaps they're aware it offers no benefit - but wouldn't do any harm either.

I did note a few older threads discussing that all images should have an alt and that in the case of tracking pixels, an empty alt would be most appropriate. However, neither FB nor Google have an alt at all.


This question is not about how to track users on our site. My company is providing the tag that others use for their tracking. We're the second most prolific web tag behind Google Analytics. If I add an alt attribute, it will be included across all websites who install our tag moving forward. This is not about adding an alt attribute to a single tag on our own website.

  • What keywords would you include, and for what purpose? Is the idea to provide SEO benefit to you (even though it doesn't sound like the image is a link back to your website)? – Tim Fountain May 4 '17 at 17:36
  • 1
    That sounds like hidden text and keyword stuffing to me. Each of which could cause Google to penalize your website. – Stephen Ostermiller May 4 '17 at 17:47
  • 1
    It sounds to me like you need to find another SEO. Alt text does nothing for SEO with the exception of image search. As well, it concerns me that any SEO would recommend anything for the alt text on a tracking image. Ask the SEO why he is recommending this step. If he says it will help with keyword performance, first the idiot immediately. Cheers!! – closetnoc May 4 '17 at 23:07
3

The answer from the HTML perspective

  1. Almost every img element must have an alt attribute.

    Almost, because there are two exceptions: under certain conditions, if figure is involved, and if a markup generator is unable to obtain a suitable alt value from the author. But these exception don’t apply to your case.

  2. In your case, the alt content must be empty, because the image is not intended for your visitors (i.e., it’s not relevant content).

    The alt guidelines in the HTML spec mention a case like yours:

    If an img element is being used for purposes other than showing an image, e.g., as part of a service to count page views, use an empty alt attribute.

The answer from the SEO perspective

It should have no relevance to SEO, as search engines would have no reason to be interested in tracking pixels. Unless, of course (like always), if you use it with bad intentions.

Adding keywords to the tracking pixel’s alt content would certainly be such a bad intention.

There is no good reason why this should be done (it goes against the HTML spec, it’s bad for accessibility, it serves no purpose for your human visitors), instead it smells like keyword stuffing. While it’s probably safe to assume that most search engines don’t fall for this anymore, this doesn’t make it okay or safe to do.

| improve this answer | |
1

If you must use a 1-pixel image to track information, then to please the world (including SEO testing tools), include the ALT tag and set it to ".". After all, a dot is a pixel.

If you want to track information about a user while they access your pages, there are alternate ways of doing it.

One way (without the greatest amount of security) to do it is to pass the information as part of the URL and continue doing it until the information is no longer needed. create a simple HTML form with one text box and a submit button using the GET method and run it. As soon as you type something in the box and click the button, your URL will change from:

http://www.example.com/whatever

to

http://www.example.com/whatever?textbox=somedata

That's assuming the box is named textbox and what you typed in was somedata. That's the easiest way to pass information from one page to the next.

Now a better way, which is more difficult and requires some kind of scripting (like PHP and maybe even javascript) is cookies. On the initial page where data is to be collected, set a cookie with any name and value and an expiry far in the future. The next time the guest returns to the page, the cookie can be retrieved. Prime examples of pages that use this are pages that change based on if you're logged in or not such as this page.

But ultimately, I recommend tracking data via cookies as setting a value of a cookie only applies to the guest accessing the page at that time.

Now if you want to receive info about a user at the time they access the page instead of tracking them with the methods above, then consider reading environment variables. For example, in PHP the environment can be read with the $_SERVER variable and information such as the user's IP address and such can be retrieved.

| improve this answer | |
  • The OP may be talking about one of the various bug options for a web performance tool such a Piwik. – closetnoc May 4 '17 at 23:02
1

Unless there is a <a>surrounding that <img> then you run little risk of being penalized no matter what keywords you decide to use in the ALT. It may, however, affect your link diversity profile with Google, it's hard to say for certain because I don't think there's ever been a large-scale case study of what you're asking.

It is, however, likely to violate Google's recommended guidelines or Terms, because there's never any reason to have irrelevant keywords in an alt tag unless you're attempting to manipulate the search result.

HOWEVER!!! I do not approve for obvious reasons

If your site is potential going to use a 'FAKE' alt attribute then you are potentially making your customer's sites have less accessibility for impaired users.

Use the ALT for users, not search engines!

The ALT tag was never designed for search engines, it was designed for impaired users. If you care about accessibility and you should not promote this method.

The correct alt tag would be:

  • A visible 1x1 white pixel should have the alt="white pixel"
  • A invisible 1x1 white pixel should have a blank alt alt="".

If you want your branding to appear in the ALT then use a 16x16 logo rather than a pixel. It'll only increase the image by a few bytes if done correctly. But if the pixel is never directly visible on the page then it would not need a ALT tag value, keep it blank. Having one would be merely to satisfy Google insights and other website checkers.

| improve this answer | |
  • 2
    I'd argue that alt="" would be correct. Any non-visible element shouldn't be described for screen readers. – Stephen Ostermiller May 4 '17 at 23:00
  • Oh, the pixel is hidden? then yes, no alt. – Simon Hayter May 4 '17 at 23:09
  • Oh but @StephenOstermiller they are using <noscript> so wouldn't that merit the usage of an ALT tag? Since it's not common practice to hide elements within the noscript, therefore the image should have a ALT tag for when users disable JavaScript? – Simon Hayter May 4 '17 at 23:14
  • alt="" is correct, as Stephen said. This is not the same as no alt. – Tim Fountain May 5 '17 at 9:58
  • Your both technically right under the HTML spec as Unor's answer confirms. I thought blank was treated as the same but obviously isn't. Thanks, edited and updated. – Simon Hayter May 5 '17 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.