Skip to content

Instantly share code, notes, and snippets.

@SeanHood
Last active March 8, 2019 09:29
Show Gist options
  • Save SeanHood/8a849cfc3c6d00f41414779ea6696425 to your computer and use it in GitHub Desktop.
Save SeanHood/8a849cfc3c6d00f41414779ea6696425 to your computer and use it in GitHub Desktop.
akamai/boomerang and Angular 2+ RUM
<!--
akamai/boomerang for Angular 2.x and up
Could only find docs for Angular 1.x
This is the order plugins need to be included. Boomerang, auto-xhr, spa, history.
Unsure about md5, I was getting errors from something without it.
Once things are in this order I saw `spa` and `spa_hard` navigations being sent to the beacon.
/api/boomerang is an endpoint which can receivce GET query strings or POST data and push it
into our observabilty platform as a JSON blob. Returning a 204 status code.
n.b It's advised not to include scripts in this way but as an example it works
-->
<script type="text/javascript" src="assets/boomerang/boomerang.js"></script>
<script type="text/javascript" src="assets/boomerang/plugins/auto-xhr.js"></script>
<script type="text/javascript" src="assets/boomerang/plugins/spa.js"></script>
<script type="text/javascript" src="assets/boomerang/plugins/history.js"></script>
<script type="text/javascript" src="assets/boomerang/plugins/md5.js"></script>
<script>
BOOMR.init({
beacon_url: "https://example.com/api/boomerang/",
instrument_xhr: true,
History: {
enable: true,
auto: true
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment