Skip to content

Commit

Permalink
fix: added fn configureDefaults() to up-ga.js
Browse files Browse the repository at this point in the history
  • Loading branch information
bjagg committed Sep 14, 2024
1 parent 0184f21 commit 1f6bb61
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ var uportal = uportal || {};
return up.analytics.model.defaultConfig;
};

/**
* Set the defaultConfig.config array as global settings
*/
var configureDefaults = function(propertyConfig) {
const defaults = propertyConfig.config;
defaults.forEach(function(setting) {
Object.entries(setting).forEach(function([key, value]) {
gtag('set', key, value);
})
});
}

/**
* Set the dimensions that apply to the current user
*/
Expand Down Expand Up @@ -371,6 +383,9 @@ var uportal = uportal || {};
return;
}

// Set default config
configureDefaults(propertyConfig);

// Create the tracker
createTracker(propertyConfig);

Expand Down

0 comments on commit 1f6bb61

Please sign in to comment.