Who can use this feature?
👤 Available on Enterprise plans
Custom Scripts allow you to bring in specific functionality and customizations that aren’t available natively in Stacker. For example, you can add a custom script for Google Analytics to learn about how your customers are using your Stacker app, or you could integrate with Weglot to translate your app into a different language.
Add a Custom Script
- Click App Settings
- Click General
- Click Custom Scripts
- Paste your custom script in the relevant box to Run Once or Per page change
- Enclose your script in script tags:
<script> </script>comments can be included as well
- Click Save
Scripts to run once
- The run once scripts run when the app component is mounted. In other words, when the app loads up for the first time, or the whole app is reloaded.
- Scripts to be run once include Google Analytics and Google Tag Manager.
Scripts to run per page change
- Whenever the URL changes, but the whole app doesn’t reload. This is noticeable by the app bar and navigation bar not disappearing.
- Example of scripts to be run per page: FreshChat, Front App, Pendo and Weglot.
Allow admins to add Custom Scripts to apps
- Click Workspace Settings
- Click Advanced
- Find Enable self-serve custom scripts
- Select Everyone in the dropdown
- Click Save
App admins will now be able to add custom scripts to any app in your Workspace.
Allowing app admins to insert custom scripts gives your admins a lot of flexibility to expand an app’s functionality and customizations. But there are some security implications you need to be aware of.
Custom scripts give you the power to execute arbitrary code in the browsers of anyone using the app where the code has been added.
That means the code has the potential to access any data that a user has access to in Stacker – including in other Stacker apps, and other workspaces the user is a member of.
In addition, it is theoretically possible to insert a script that breaks your app and makes your app unusable.
If you’re unsure about a script you’re considering adding to your apps, reach out to your Customer Success Manager to find out more.
Stacker doesn’t vet the scripts that are inserted into apps, so it is up to individual workspace owners to check any scripts inserted into apps in their workspaces themselves.
|Custom Domain||Custom Pages|