Versions Compared

Key

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

...

  • Go to the admin panel (by adding /admin to the domain).

  • There, go to: Organizations > Your Organization

  • Add the script without the <script> tag into the Extra Script box

  • Click on Save

Example:

...

Migrating from the old format

Up to version 24.12, the extra-scripts was interpreted as HTML and contained also <script> tags.

This was changed in 24.12(See https://3yourmind.atlassian.net/wiki/spaces/PD/pages/2245394433/24.12+LTS#Extra-Scripts . Now the content of the extra-scripts is interpreted as JavaScript and added to the Document as an external script.

To ensure backwards compatibility, all existing scripts have been wrapped like this: document.write(`[old script]`).

We encourage customers who currently use an extra-script to manually remove the document.write again and transform the existing scripts into plain javascript and css.

To do the migration, modify the extra-script as follows:

  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