@@ -30,7 +30,6 @@ function clearSessionIdCache() {
3030function Fraudnet ( ) { }
3131
3232Fraudnet . prototype . initialize = function ( options ) {
33- var environment = options . environment ;
3433 var self = this ;
3534
3635 this . sessionId = options . sessionId || options . clientSessionId ;
@@ -43,12 +42,24 @@ Fraudnet.prototype.initialize = function (options) {
4342 cachedSessionId = this . sessionId ;
4443 }
4544
46- this . _beaconId = _generateBeaconId ( this . sessionId ) ;
45+ var parameterBlockConfig = {
46+ f : this . sessionId ,
47+ s : FRAUDNET_SOURCE ,
48+ } ;
49+
50+ if ( ! options . hasOwnProperty ( "beacon" ) || options . beacon === true ) {
51+ parameterBlockConfig . b = _generateBeaconId ( this . sessionId ) ;
52+ } else {
53+ parameterBlockConfig . bu = false ;
54+ }
55+
56+ if ( options . hasOwnProperty ( "cb1" ) ) {
57+ parameterBlockConfig . cb1 = options . cb1 ;
58+ }
59+
4760 this . _parameterBlock = _createParameterBlock (
48- this . sessionId ,
49- this . _beaconId ,
50- environment ,
51- options . cb1
61+ parameterBlockConfig ,
62+ options . environment
5263 ) ;
5364
5465 return loadScript ( {
@@ -95,15 +106,8 @@ function _generateBeaconId(sessionId) {
95106 ) ;
96107}
97108
98- function _createParameterBlock ( sessionId , beaconId , environment , cb1 ) {
109+ function _createParameterBlock ( config , environment ) {
99110 var el = document . body . appendChild ( document . createElement ( "script" ) ) ;
100- var config = {
101- f : sessionId ,
102- s : FRAUDNET_SOURCE ,
103- b : beaconId ,
104- cb1 : cb1 ,
105- } ;
106-
107111 // for some reason, the presence of the sandbox
108112 // attribute in a production environment causes
109113 // some weird behavior with what url paths are
0 commit comments