Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Make a backup of the existing extra-script.

  2. Remove the document.write(` at the top and the `)at the end

  3. Remove all HTML comments (e.g. <!-- Google Tag Manager --> ) OR convert them into JavaScript Comments: (e.g. // Google Tag Manager )

  4. Remove the <noscript> sections

  5. Change the way external <script>s are called:

    1. From: <script src="[some URL]"></script>

    2. To:

      Code Block
      var script = document.createElement("script");
      script.src = [some URL];
      document.head.appendChild(script);  

  6. If the original call included an async tag change it like this:

    1. From: <script async src="[some URL]"></script>

    2. To:

      Code Block
      var script = document.createElement("script");
      script.src = [some URL];
      script.async = true;
      document.head.appendChild(script);  

  7. Move the content of the <style> test into the extra-style textarea (ommiting the <style> tag itself)

  8. Remove the remaining <scipt> and </script> tags, keeping the content.

  9. Save and test your changes