diff --git a/uPortal-webapp/src/main/webapp/media/skins/common/javascript/uportal/up-ga.js b/uPortal-webapp/src/main/webapp/media/skins/common/javascript/uportal/up-ga.js index d04a86d83ed..3e8dde97fbc 100755 --- a/uPortal-webapp/src/main/webapp/media/skins/common/javascript/uportal/up-ga.js +++ b/uPortal-webapp/src/main/webapp/media/skins/common/javascript/uportal/up-ga.js @@ -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 */ @@ -371,6 +383,9 @@ var uportal = uportal || {}; return; } + // Set default config + configureDefaults(propertyConfig); + // Create the tracker createTracker(propertyConfig);