The function google_tag_realm_values() makes an assumption that, if variable_realm is enabled, then the non-realm snippet won't be loaded, regardeless of the fact that there's no google_tag variables internationalized.
So, if I use i18n variables in my website, but don't set any of the google_tag variables to be localized, it will try to load the localized snippet, which does not contain any configuration set:
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0];var j=d.createElement(s);var dl=l!='dataLayer'?'&l='+l:'';j.type='text/javascript';j.src='//www.googletagmanager.com/gtm.js?id='+i+dl+'>m_auth=>m_preview=>m_cookies_win=x';j.async=true;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','');
Note the missing environment, token and container ID, which are all properly configured as global variables (not sensitive to language realms).
It seems that google_tag_realm_values() should check also if there's any google_tag variables internationalized, otherwise the non-realm snippet should be used.
Comments
Comment #3
PasqualleThis change seems to fixed my issue with missing google_tag js files under files/google_tag/language/..
Comment #4
solotandem CreditAttribution: solotandem commentedThanks for the feedback. Changing status to fixed.