If you're concerned with GDPR compliance, ensure that any third-party forms or code involving heat-mapping or tracking are not interacting with your leads.
What is Script Manager?
Script Manager allows you to apply scripts to all of the pages in a custom domain (or multiple domains) via a single process. If you have scripts (like Google Analytics) that you need to apply to many pages, Script Manager is designed to make your life a lot easier.
Please note that the use of Script Manager requires your own custom domain. You cannot use this feature with the test domain 'unbouncepages.com.'
To add a script:
- Click on Settings in the left menu. A new drop-down menu will appear.
- Select Script Manager.
- Click the Add a Script button at the top right of the screen. A dialog box will appear.
- In the new Add a Script dialog box, Enter a name for your script and click the Add Script Details button.
- Use the Placement drop-down menu to choose the placement of your script.
- Use the Included on drop-down menu to choose whether you want your script added to your main pages, confirmation dialog pages, or both.
- Paste or type your script in the editor window.
- Choose the domain(s) that you would like to add your script to via the checkboxes on the right.
- Click the Save Changes button near the bottom left of the screen.
Your script will be applied to all pages for the chosen domain and will be applied automatically to all new pages published to the same domain as well.
Ordering Scripts in Script Manager
Do note that Global scripts added into the Script Manager will load after scripts added in your landing page variants. For more details about script ordering, check out our documentation here: Does Order Matter When I'm Adding Custom Scripts to My Landing Page?
Also, if you have pages under a domain that already contains the script you wish to add, this can cause the code to execute twice. Be sure to remove the page-level script before adding it on a domain level to avoid any conflicts.
Disabling, Deleting, and Editing Scripts
Disable (or re-enable) or delete a script via the cog menu for each script.
Enter the edit screen for any script by clicking anywhere else on the grey bar for each script.
Migrating Scripts to Script Manager
When adding a script to Script Manager, it's generally important to make sure that the script isn't already on any of your pages. Otherwise, when you add it to Script Manager it could end up being run twice. For tracking scripts like Google Analytics or Google Ads Conversion Tracking, this will result in multiple page views or conversions, and inaccurate data.
The best way to avoid this is to go through each page and remove the script from the page, before adding it to Script Manager.
This is a one-time process similar to the Google Tag Manager's migration process.
If you are concerned about not tracking pageviews or conversions in the time period between removing the script from a page and re-adding it to Script Manager, we'd recommend deleting the script on all your pages, but not republishing them yet. Then, once the script is gone from all your pages, you can add the script to Script Manager and then go through and quickly republish the pages, which should cut down this period of time significantly.
Script Manager - Advanced Tips and Tricks
Using Page-Level Variables
There are some page-level variables that Script Manager scripts can make use of.
window.ub.page.id – Unbounce's internal ID for your page. IDs are unique to each page, so they could be useful to differentiate between pages – e.g. "a07b7610-6a9e-11e4-b67a-22000b6882a2"
window.ub.page.variantId – the ID letter of the current variant – e.g. "a"
window.ub.page.name – the name you have given the page inside Unbounce – e.g. "My Page Name"
You could use these to have your script behave differently on different pages, or variants. For example, you could send the variantId as a custom variable to your analytics platform.
Other Articles You May Find Useful: