SEARCH
Showing results for 
Search instead for 
Do you mean 
Reply
Visitor
Posts: 1
Registered: ‎05-09-2017

Boomerang in react

[ Edited ]

Hi Team,

Am trying to implementing RUM in react application using with Boomerang .

I have include sosta mpulse boomerang script in head of  my main index.html page . And added BOOMR.init()/hookHistoryBoomerang() functions in root index.js to initilize the beacon request .

And downloaded boomerang plugis are also available in public floder and imported same in root index.js .

 

But am not getting success beacon results .please help me to fix this issue .

My root index.js look like to this :

 

import React,{Component} from 'react'
import { render } from 'react-dom'
import { createStore } from 'redux'
import { Provider } from 'react-redux'
import App from './components/App'
import reducer from './reducers'

 

import { Router, Route} from 'react-router';

 


import BOOMR from './../public/boomerang'
import navtiming from './../public/navtiming'
import rt from './../public/rt'
import restiming from './../public/restiming'
import spa from './../public/spa'
import history from './../public/history'
import autoxhr from './../public/auto-xhr'

 

 

var hadRouteChange;

 

 

BOOMR.init({

History: {
enabled: true,
},
autorun: true,
instrument_xhr: false,
RT: {
cookie: "MyRT",
cookie_exp: 120
},

beacon_url: "https://nodejs-for-react-indhusiva.c9users.io:8081/beacon"
});

function hookHistoryBoomerang() {
if (window.BOOMR && BOOMR.version) {
if (BOOMR.plugins && BOOMR.plugins.History) {
BOOMR.plugins.History.hook(history, hadRouteChange);
}
return true;
}
}

 

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

 

 

/* function onEnter() {
hadRouteChange = true;
} */

 


const store = createStore(reducer)

render(
<Provider store={store}>

<App />
</Provider>,

document.getElementById('root')
)

 

 

 

 

 

Thanks

Siva

Community Manager
Posts: 244
Registered: ‎06-22-2014

Re: Boomerang in react

Hi, did you follow the steps in this document: http://docs.soasta.com/boomerang/#introduction ?

 

Check the React section.

 

You also need to have an App created in mPulse to get the APIKey, unless you are trying to send the beacons to your own server?