This is a simple script to convert GTM code to a JS-friendly syntax ensuring your code editor is happy.
- Copy gtmCodeFormatter.sh to local directory (you could have this somewhere convenient like ~/bashScripts/ or C:\)
- To convert GTM code -> JS code
- ./gtmCodeFormatter.sh FILE_NAME 'js'
- To convert JS code -> GTM code
- ./gtmCodeFormatter.sh FILE_NAME 'gtm'