Web Adverts vs Web Standards
– Updated: – publicAs a web user, I have come to accept that without advertising revenue some of my favourite sites would not exist. As a designer, I have also come to accept that integrating and balancing advertising needs is a fundamental part of commercial web design.
The problem with web adverts is their total disregard for usability and web standards. Over the last couple of years we have seen some major commercial publishers move to a web standards approach. For the designers of these sites one of the biggest issues is integrating the advertiser’s code.
With the growth of rich media adverts we have moved away from inserting simple banner images and hyperlinks to the extensive use of JavaScript. This type of code is very intrusive, and although it can often degrade gracefully, it causes many rendering problems.
Today, most adverts have to be inserted using inline blocks of JavaScript. This code calls external JavaScript files on others servers. These files can be chained so that one file calls another repetitively. The last file will write HTML into the page using the document.write function.
Some of the issues are:
- Obtrusive inline JavaScript blocks
- Mixes structural code and behaviour
- The advertisement HTML is not written to any DOCTYPE or standard
- Makes it impractical to use the document onload event to add other behaviours
- A large amount of code is loaded even if no adverts are displayed
- Can compromise the semantic structure of pages
- Uses the document.write function instead of the DOM model
- The JavaScript often uses browser detection instead of object detection
Over the last few months I have noticed a growth in the number of JavaScript errors and CSS rendering problems. These are often caused because advertiser’s code is generic and unsuitable for standard-based web pages (HTML4 or XHTML).
In fact the problem is that this methodology is blind to the structure of the page into which it will insert its HTML. There are some major differences between XHTML rending in strict compliance mode and old HTML coded sites. CSS layouts do not render exactly the same and some JavaScript will stop working altogether.
In a recent site I designed, the inline JavaScript for adverts made up 30% of the total HTML file size. This code would make at least 8 calls for external JavaScript files, but often only displayed 4 adverts.
Using the document.write function causes the browser to stop rendering while it waits for external assets to be downloaded. This makes the rendering of the page very slow, often the user will start to interact with the document before it has completely loaded. Any JavaScript enhancement which use of the document onload event may take a long time to load. The users find it very disconcerting for enhancements to suddenly be added to a page well after they have started interacting with it.
Over the last year Google has made the AdSense format very popular. This easy-to-use format has spread to personal sites and blogs. AdSense text format gives the impression that it’s lean and clean, but the delivery mechanism is roughly the same as rich media web adverts. It does not answer all the undying issues of obtrusive inline JavaScript blocks and mixing structural code and behaviour.
What you start to realise is that the problem in some part lies with the web adverts management software which is built to serve rich formats through chained JavaScript files.
I believe what is needed is a true syndication model for web adverts. It would not be too much effort to describe all the properties of current web adverts in an XML document. This could then either be used by a server script to add code directly into the HTML or by a DOM Script client side.
If content was syndicated, it could be completely shoe-horned into any document structure correctly. The XML would have to carry the presentation requirements of the advertiser, but the site designer could choose the exact HTML output to match the page. The advertiser may lose a little presentational control, but they would gain a format that would be device independent.
It would always be in the interest of the hosting site to display the adverts to its best ability as the advertisers will always be able to measure the effectiveness of a campaign with click-through metrics.
The technology to create an advert syndication model is well tested and understood. To change, the development community needs to recognise and then stand-up to this current bad practice. There will be resistance to change from the advertising industry, but standardisation is in everyone’s long-term interest.
I would be very interested in other people’s experience of implementing web adverts. If there is already an alternative approach which addresses the issues I have mentioned.