@@ -50,14 +50,22 @@ var constructor = function () {
5050 _service ,
5151 testMode ,
5252 _trackerId ,
53- filteredUserAttributes
53+ filteredUserAttributes ,
54+ filteredUserIdentities ,
55+ appVersion ,
56+ appName ,
57+ customFlags
5458 ) {
5559 var accountId = settings . accountId ;
5660 self . userAttributes = filteredUserAttributes ;
5761 self . onboardingExpProvider = settings . onboardingExpProvider ;
5862
63+ var customIntegrationName =
64+ customFlags && customFlags [ 'Rokt.integrationName' ] ;
65+ var integrationName = generateIntegrationName ( customIntegrationName ) ;
66+
5967 if ( testMode ) {
60- attachLauncher ( accountId ) ;
68+ attachLauncher ( accountId , integrationName ) ;
6169 return ;
6270 }
6371
@@ -78,7 +86,7 @@ var constructor = function () {
7886 typeof window . Rokt . createLauncher === 'function' &&
7987 window . Rokt . currentLauncher === undefined
8088 ) {
81- attachLauncher ( accountId ) ;
89+ attachLauncher ( accountId , integrationName ) ;
8290 } else {
8391 console . error (
8492 'Rokt object is not available after script load.'
@@ -168,15 +176,10 @@ var constructor = function () {
168176 delete self . userAttributes [ key ] ;
169177 }
170178
171- function attachLauncher ( accountId ) {
179+ function attachLauncher ( accountId , integrationName ) {
172180 window . Rokt . createLauncher ( {
173181 accountId : accountId ,
174- integrationName :
175- 'mParticle_' +
176- 'wsdkv_' +
177- window . mParticle . getVersion ( ) +
178- '_kitv_' +
179- process . env . PACKAGE_VERSION ,
182+ integrationName : integrationName ,
180183 } )
181184 . then ( function ( launcher ) {
182185 // Assign the launcher to a global variable for later access
@@ -274,6 +277,17 @@ var constructor = function () {
274277 }
275278} ;
276279
280+ function generateIntegrationName ( customIntegrationName ) {
281+ var coreSdkVersion = window . mParticle . getVersion ( ) ;
282+ var kitVersion = process . env . PACKAGE_VERSION ;
283+ var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion ;
284+
285+ if ( customIntegrationName ) {
286+ name += '_' + customIntegrationName ;
287+ }
288+ return name ;
289+ }
290+
277291function getId ( ) {
278292 return moduleId ;
279293}
0 commit comments