The Scripts integration allows you to embed custom Javascript in your web app. For example, it's common for third-party analytics tools to have a code snippet that you add to your website to track events, or you might want to add your own code. The Scripts integration makes that possible.
β οΈ WARNING: Not all scripts will work. You are responsible for catching and troubleshooting any errors in the scripts you add. Also, don't use a script to try to modify your app's behavior or UI.
π‘ NOTE: Each script input only accepts valid HTML for a single script. You must include the opening and closing script tags, and you must not include the type attribute.
Examples
A simple hello world script:
<script>
console.log("hello world")
</script>
A script to load Javascript from a URL (replace https://example.com):
<script src="https://example.com"></script>
A script to load Google Tag Manger (replace YOUR-GTM-ID):
<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','YOUR-GTM-ID');</script>