Moved to https://developer.akamai.com/tools/boomerang#mPulseNon-BlockingLoaderSnippet
This is a loader snippet for boomerang (https://github.com/soasta/boomerang) that doesn't use the iframe except for legacy browsers, and does not use document.write
If an iframe is required, it is injected into the page immediately or soon after the script, so you may place the script wherever in the HTML you would like the iframe to show up.
For IE6 & 7, we will fallback to a same-window iframeless dynamic script node. This does mean that the script will be a Single Point of Failure for these two browsers, but given the low combined market share of these two browsers, the choice is between not getting any beacons for these browsers or potentially being a SPoF for users of these browsers.
You MUST include everything, including the <script>
node with exactly the same id
attribute.
Replace "YOUR-API-KEY-GOES-HERE" with your actual API key (in quotes)
It is best to use boomerang version 1.571 or higher with this loader.
This loader and its CSP compliance is documented at https://calendar.perfplanet.com/2018/a-csp-compliant-non-blocking-script-loader/
Thanks Philip.
I've turned this into an ES6 class for when we load this, and I've made some modifications to the element placement.
Basically, we're working on a theory that Google isn't parsing our canonical URLs correctly because there's an <iframe> element in the , which is semantically incorrect and those aren't allowed there. So, I've changed the
where
variable into ahead
variable instead for the preload link method, and if we fall back to the iframe it'll be appended to the end of the body.Also, the
doc
variable in theiframe_loader
method isn't used at all. Is that intentional?