Skip to content

Commit

Permalink
read el values
Browse files Browse the repository at this point in the history
  • Loading branch information
sayan-rudder committed Feb 17, 2020
1 parent 753b71c commit 7b1e56b
Show file tree
Hide file tree
Showing 2 changed files with 219 additions and 173 deletions.
51 changes: 29 additions & 22 deletions analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,36 @@ class Analytics {
* @memberof Analytics
*/
processResponse(status, response) {
logger.debug("===in process response=== " + status);
response = JSON.parse(response);
if (response.source.useAutoTracking || true) {
addDomEventHandlers(this);
autoTrackHandlersRegistered = true;
}
response.source.destinations.forEach(function(destination, index) {
logger.debug(
"Destination " +
index +
" Enabled? " +
destination.enabled +
" Type: " +
destination.destinationDefinition.name +
" Use Native SDK? " +
destination.config.useNativeSDK
);
if (destination.enabled) {
this.clientIntegrations.push(destination.destinationDefinition.name);
this.configArray.push(destination.config);
try {
logger.debug("===in process response=== " + status);
response = JSON.parse(response);
if (response.source.useAutoTracking || true) {
addDomEventHandlers(this);
autoTrackHandlersRegistered = true;
}
}, this);
this.init(this.clientIntegrations, this.configArray);
response.source.destinations.forEach(function(destination, index) {
logger.debug(
"Destination " +
index +
" Enabled? " +
destination.enabled +
" Type: " +
destination.destinationDefinition.name +
" Use Native SDK? " +
destination.config.useNativeSDK
);
if (destination.enabled && destination.config.useNativeSDK) {
this.clientIntegrations.push(destination.destinationDefinition.name);
this.configArray.push(destination.config);
}
}, this);
this.init(this.clientIntegrations, this.configArray);
} catch (error) {
handleError(error);
if (!autoTrackHandlersRegistered) {
addDomEventHandlers(this);
}
}
}

/**
Expand Down

0 comments on commit 7b1e56b

Please sign in to comment.