What is it?
A website custom script is a block of code that is run every time the Ascend runtime is loaded onto a page. It runs before any Ascend experiment code and is configured in the Ascend interface at a per website level.
Why would I use a website custom script?
- To create helper functions that will be used repeatedly across multiple experiments
- Setup integration points with other tools using Ascend's lifecycle events
- Setup User Attribute information to pass to Ascend for audience filters
Website custom script allow you to easily write and deploy custom code without requiring a code release
How to use it
Go to the settings section and select 'Custom Scripts'
Enter your code. In this example, we have added a helper function to read cookies and added two properties to our AscendUser object.
Your code is automatically saved, but to get it live you must publish the script. By publishing versions of the script, it is easier to find the previous code and revert back if there is a mistake.
Use with Lifecycle Events
Ascend Lifecycle events can be referenced here to apply changes to specific pages in an experiment