question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Akamai RUM Breaks AMP Pages (some % of the time)

See original GitHub issue

In 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

  1. In Akamai Property Manager, create a new rule with a blank template. image

  2. In that rule, add a criteria containing a path match for AMP content and a behavior that disables RUM injection. image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
cvazaccommented, Jun 8, 2018

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.

0reactions
jamesshannoncommented, Jul 20, 2018

Yeah. I think the remaining domains were just a function of the latencies in grepping the internet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Akamai Blog | Measuring and Improving Core Web Vitals
General enough to report valid results across all webpages. The experience of a page load can be broken down into four stages: Is...
Read more >
Real user monitoring (classic) reports replaced by mPulse ...
Real user monitoring (classic) reports are to be discontinued on May 31, 2023. In place of these reports you can use mPulse, an...
Read more >
Real User Monitoring - Akamai TechDocs
Real User Monitoring (RUM) provides performance monitoring of webpages based on data collected from real end-users. With RUM, you can gather data about...
Read more >
AMP Page mPulse integration - Akamai TechDocs
AMP (Accelerated Mobile Pages) is a way to build web pages for static content that render fast. AMP has built-in support for collecting...
Read more >
Cumulative Layout Shift in the Real World | NicJ.net
Boomerang measures CLS up to the Page Load or SPA Page Load event, ... Akamai's mPulse RUM product uses boomerang.js to gather performance ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found