Skip to main content

Web Scripts

Updated over a week ago

The Web Scripts integration allows you to embed custom Javascript in your web app. For example, you can use this integration to add a code snippet from a third-party analytics tool to track events in your web app.

Limitations

⛔️ Do not attempt to use web scripts to modify existing elements in your app’s user interface. This is not supported, and attempting to do this will cause unexpected problems for your users.

⚠️ Not all scripts may be compatible with our system. You are responsible for testing your scripts and troubleshooting any errors.

  • Web scripts will only run in your web app. They will not run in your native iOS or Android apps.

  • Web scripts will not run in the app preview embedded in your admin dashboard. To test web scripts, open your app preview in a new tab.

  • Adding too many scripts will degrade the performance of your web app for all of your users. We recommend keeping the number of scripts you load to an absolute minimum.

Usage

Click on “Web Scripts” under “Integrations” in your Treefort dashboard to add, update, or remove scripts.

Each script input accepts valid HTML for a single script. You must include the opening and closing script tags, and you must not include the type attribute. Your script can include inline code or a src attribute referencing a hosted script.

Individual scripts can be enabled or disabled using the toggle above the script input. This can be helpful when you want to temporarily disable a script, or if you are trying to identifying which script is at fault when troubleshooting an error.

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>

Did this answer your question?