Akamai RUM Breaks AMP Pages (some % of the time)
See original GitHub issueIn the spirit of other issues (#2380 and #5051) tracking CDNs which break AMP page (validation), I wanted to log something for Akamai. Those issues are for Cloudflare and Incapsula, respectively, and have both been closed.
I discovered that Akamai injects Real User Measurement javascript into the <head> of pages it servers. AFAIK, this is some percent of the time – either 5% or 10%. When this occurs you’ll see code like the following immediately preceding the </head>
tag:
<script>var w=window;if(w.performance||w.mozPerformance||w.msPerformance||w.webkitPerformance}var d=document;AKSB=w.AKSB||{},AKSB.q=AKSB.q||{},AKSB.mark....
</script>
</head>
This has been noticed in the wild, though isn’t easily diagnosed (because it’s unlikely to occur on reload).
I reached out to Akamai in November and they’re aware of this and working on a fix. However, I’m seeing that this affects about 1M URLs per day across many top domains. In the meantime, companies need to individually configure their Akamai accounts to exclude their AMP pages from RUM injection.
Akamai provided the following:
Instructions for Excluding AMP Content from Akamai’s Automated RUM injection
-
In Akamai Property Manager, create a new rule with a blank template.
-
In that rule, add a criteria containing a path match for AMP content and a behavior that disables RUM injection.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (11 by maintainers)
We have begun to roll out the fix (don’t inject script into documents we identify as AMP) on a product by product basis. I will comment here when we are done.
Yeah. I think the remaining domains were just a function of the latencies in grepping the internet.