Skip to content

Instantly share code, notes, and snippets.

@andreas-marschke
Created October 31, 2014 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreas-marschke/41d47c9cfeebbcee8fb2 to your computer and use it in GitHub Desktop.
Save andreas-marschke/41d47c9cfeebbcee8fb2 to your computer and use it in GitHub Desktop.
b.js - Boomerang Setup in around 500 bytes
/* b.js - Boomerang Setup in around 500 bytes
* ------------------------------------------
* Complete boomerang.js initialization with essential plugins in around 500 bytes
* It mimics "Google Analytics"-style script injection using document.createElement
* and document.head.appendChild().
*
* Beacon URL configuration + configuring Plugins as a variable to the beacon:
*
* http://boomerang.example.org/beacon/0000/dashboard/start?plugins=BW%7CRT%7Cnavtimin%7Crestiming&...
*
* Checkout the boomerang project at: github.com/lognormal/boomerang
* and my Boomerang reciever Server: github.com/andreas-marschke/boomerang-express
*/
(function(b,d){var a=["//boomerang.example.org/","0000/dashboard/start","plugins","BOOMR"],c=d.createElement("script");c.src="/js/boomerang.js";d.head.appendChild(c);c.onload=function(){b[a[5]].init({beacon_url:a[0]+"beacon/"+a[1],DNS:{base_url:a[0],strict_referrer:!1},BW:{base_url:a[0],cookie:"bandwidth",nruns:1},RT:{},ipv6:{},clicks:{click_url:a[0]+"click/"+a[1],onbeforeunload:!0}});b[a[3]].addVar(a[2],Object.keys(b[a[3]][a[2]]).join("|"))}})(this,this.document);
@bluesmoon
Copy link

And I sort of solve the init part by just calling it at the bottom of my combined & minified boomerang.js file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment