...
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 boxClick 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:
Make a backup of the existing extra-script.
Remove the
document.write(`
at the top and the`)
at the endRemove all HTML comments (e.g.
<!-- Google Tag Manager -->
) OR convert them into JavaScript Comments: (e.g.// Google Tag Manager
)Remove the
<noscript>
sectionsChange the way external
<script>
s are called:From:
<script src="[some URL]"></script>
To:
Code Block var script = document.createElement("script"); script.src = [some URL]; document.head.appendChild(script);
If the original call included an
async
tag change it like this:From:
<script async src="[some URL]"></script>
To:
Code Block var script = document.createElement("script"); script.src = [some URL]; script.async = true; document.head.appendChild(script);
Move the content of the
<style>
test into the extra-style textarea (ommiting the<style>
tag itself)Remove the remaining
<scipt>
and</script>
tags, keeping the content.Save and test your changes