1

I am trying to use boomerangJS for SPA built using AngularJS

using plugins: plugins/rt.js plugins/navtiming.js plugins/auto_xhr.js plugins/spa.js plugins/angular.js

with init

BOOMR.init({
    beacon_url: 'http://myValidDomaincom/test.gif',
    autorun: false,
    instrument_xhr: false
  });

Angular plugin is hooked using below code:

.run(['$rootScope', function($rootScope) {
var hadRouteChange = false;
$rootScope.$on("$routeChangeStart", function() {
    hadRouteChange = true;
});

function hookAngularBoomerang() {
    if (window.BOOMR && BOOMR.version) {
        if (BOOMR.plugins && BOOMR.plugins.Angular) {
            BOOMR.plugins.Angular.hook($rootScope, hadRouteChange);
        }
        return true;
    }
}

if (!hookAngularBoomerang()) {
    if (document.addEventListener) {
        document.addEventListener("onBoomerangLoaded", hookAngularBoomerang);
    } else if (document.attachEvent) {
        document.attachEvent("onpropertychange", function(e) {
            e = e || window.event;
            if (e && e.propertyName === "onBoomerangLoaded") {
                hookAngularBoomerang();
            }
        });
    }
}
}])

And when first time page is loaded I trigger BOOMR.page_ready(); using JS

Now when I go through the flow which loads different views, I don't see any new beacons getting triggered

  • What's the expected behavior?
  • Will boomerang trigger new beacons each time a new view is displayed on page ?
  • Am I missing any configuration or code, to get it working ?
bluesmoon
  • 3,918
  • 3
  • 25
  • 30
lucky
  • 414
  • 1
  • 7
  • 19
  • You should ask this question on the boomerang issues list here: https://github.com/lognormal/boomerang/issues The dev team actively responds to questions, and someone else may have run into this issue already. – bluesmoon May 03 '16 at 00:05
  • thx @bluesmoon added @github.com/lognormal/boomerang/issues – lucky May 03 '16 at 06:44
  • @bluesmoon can you plz check for https://github.com/SOASTA/boomerang/issues/85 – lucky May 11 '16 at 19:03
  • looks like this was handled. – bluesmoon May 16 '16 at 21:26
  • @lucky I am also trying to implement SPA in my angular 7 application. So I have added this code in index.html under script tag. However I am getting .run is undefined. I tried BOOMR.run as well but it's saying run is not a function. Can you please help me to implement in Angular7. Thanks – Vikas Jul 19 '19 at 06:14
  • @bluesmoon I am also trying to implement SPA in my angular 7 application. So I have added this code in index.html under script tag. However I am getting .run is undefined. I tried BOOMR.run as well but it's saying run is not a function. Can you please help me to implement in Angular7. Can you please share any demo application if you have created. Thanks – Vikas Jul 19 '19 at 06:15
  • @vikas, please ask on the boomerang GitHub page. Stackoverflow is not the boomerang support site. – bluesmoon Jul 22 '19 at 14:11

0 Answers0