Tracking code field Bug


#1

I tried to add GTM code in the "before " and "after " fields located in Jupiter X > Control Panel > Settings > Tracking Codes.

<script>
(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], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-XXXXXX');
</script>

Turns into this when i inspect the element:

<script>
(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], j=d.createElement(s),dl=l!=\'dataLayer\'?\'&l=\'+l:\'\';j.async=true;j.src= \'https://www.googletagmanager.com/gtm.js?id=\'+i+dl;f.parentNode.insertBefore(j,f); })(window,document,\'script\',\'dataLayer\',\'GTM-XXXXXXX\');
</script>

Basically it’s escaping every special characters in the code.


#2

We have made improvement to these fields in the latest update 1.0.3
Could you please update the theme and see if the issue still shows up?


#3

Hi,

Can confirm it works now.

Thank you :slight_smile:


#5

Danish, could you please look at this again. It’s still broken. It’s breaking all of the analytics code and we’ve lost web site tracking for a week until it was discovered. Just accessing the Settings page on the Control Panel for JupiterX causes this.