P3PC: Glam Media
P3PC is a project to review the performance of 3rd party content such as ads, widgets, and analytics. You can see all the reviews and stats on the P3PC home page. This blog post looks at Glam Media. Here are the summary stats.
impacton page | Page Speed | YSlow | doc. write |
total reqs | totalxfer size | JS ungzip | DOM elems | median Δload time |
---|---|---|---|---|---|---|---|---|
big | 89 | 83 | y | 11 | 68 kB | 63 kB | 7 | na** |
* Stats for ads only include the ad framework and not any ad content.
** It’s not possible to gather timing stats for snippets with live ads.
|
column definitions |
I don’t have an account with Glam Media, so my friends over at Zimbio let me use their ad codes during my testing. Since these are live (paying) ads I have to mask the ad codes in the snippet shown here. This means it’s not possible to crowdsource time measurements for these ads.
Snippet Code
Let’s look at the actual snippet code:
1: | <script type=”text/javascript” language=”javascript” src=”http://www2.glam.com/app/site/affiliate/viewChannelModule.act?mName=viewAdJs&affiliateId=123456789&adSize=300×250&zone=Marketplace”> |
2: | </script> |
The Glam Media ad is kicked off from a single script: viewChannelModule.act. This script is loaded using normal SCRIPT SRC tags, which causes blocking in IE7 and earlier.
Performance Analysis
This HTTP waterfall chart was generated by WebPagetest.org using IE 7 with a 1.5Mbps connection from Dulles, VA. In my analysis of ad snippets I focus only on the ad framework, not on the actual ads. The Glam Media ad framework alone constitutes 9 HTTP requests.
Let’s step through each request.
- item 1: compare.php– The HTML document.
- item 2: viewChannelModule.act– The main Glam Media script.
- item 3: ad.doubleclick.net– The actual ad (not included in my analysis).
- item 4: glamadapt_jsrv.act– Script loaded by viewChannelModule.act using document.write.
- item 5: quant.js – Quantcastscript loaded by viewChannelModule.act using document.write.
- item 6: beacon.js – ScorecardResearchscript loaded by viewChannelModule.act using document.write.
- item 7: glam_comscore.js– Script loaded by viewChannelModule.act using document.write.
- item 8: pixel– Beacon sent by quant.js.
- item 9: b.scorecardresearch.com/b– Beacon sent by glam_comscore.js. This returns a redirect to /b2 (item 11).
- item 10: glam-media-waterfall.png– The image representing the main page’s content.
- item 11: altfarm.mediaplex.com/ad/js/– The actual ad (not included in my analysis).
- item 12: b.scorecardresearch.com/b2 – Another beacon sent as a result of the redirect from /b (item 9).
Keep in mind that glam-media-waterfall.png
represents the actual content on the main page. Notice how that image is pushed back to item 10 in the waterfall chart. In this one page load, this main content is blocked for 617 + 808 = 1425 milliseconds. Here are some of the performance issues with this snippet.
1. Too many HTTP requests.
9 HTTP requests for an ad framework (not counting the ad itself) is a lot. The fact that these come from a variety of different services exacerbates the problem because more DNS lookups are required. These 9 HTTP requests are served from 6 different domains.
2. The scripts block the main content of the page from loading.
It would be better to load the script without blocking, similar to what BuySellAds.com does.
3. The ad is inserted using document.write.
Scripts that use document.write slow down the page because they can’t be loaded asynchronously. Inserting ads into a page without using document.write can be tricky. BuySellAds.comsolves this problem by creating a DIV with the desired width and height to hold the ad, and then setting the DIV’s innerHTML.
4. The redirects cause sequential downloads.
A redirect is almost as bad as a script when it comes to blocking. The redirect from b.scorecardresearch.com/b to /b2 causes those two resources to happen sequentially. It would be better to avoid the redirect if possible.
5. Some resources aren’t cacheable.
glam_comscore.js has no caching headers, and yet its Last-Modified date is Nov 19, 2009 (almost 5 months ago). quant.js is only cacheable for 1 day.
Much of the content in this snippet is served with good performance characteristics. The scripts are compressed and minified. One of the beacons returns a 204 No Content response, which is a nice performance optimization. But the sheer number of HTTP requests, use of document.write, and scripts loaded in a blocking fashion cause the page to load more slowly.
Stefan | 20-Apr-10 at 2:38 am | Permalink |
Many thanks for this review.
But an important question wasn’t answered. Most commercial websites places more than one ad on one single page. The important question is, which data will be cached from the first request and can be reused in all other ad requests. IMHO there are several concepts across the main ad networks. This is the pain for every webmasters.
Chris | 19-Jul-11 at 6:22 pm | Permalink |
I also work with glam and have to say that the ad server performance has been getting worse over time. With ads, my site takes over 10 seconds to load 3 ad units (standard leaderboard, rectangle, and skyscraper). Without ads, less than 3 seconds. Has anyone found a way to improve the performance?
Kristina | 29-Jan-12 at 3:09 pm | Permalink |
I would KILL for a way to improve this ad code. It loads SO MANY requests and the blocking aspect is killing me in terms of the leaderboard. Additionally, glam ads have to be above the fold so you’re guaranteed it messes up with the rendering of the page in terms of user experience.