diff --git a/scripts/scripts.js b/scripts/scripts.js index 56670dc3e..dd18ba994 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -362,6 +362,10 @@ function getDomainInfo(hostname) { function pushPageLoadToDataLayer() { const { hostname } = window.location; + if (!hostname) { + return; + } + const { domain, domainPartsCount } = getDomainInfo(hostname); const languageCountry = getLanguageCountryFromPath(window.location.pathname); const environment = getEnvironment(hostname, languageCountry.country);