We'll show you how you can use your pre-script to run some JavaScript before any data collection or experience activation begins.
The smartserve pre-script can be used to run some JavaScript before any data collection or experience activation begins.
It allows you to implement a wide range of bespoke use cases, tailored to your specific requirements. Examples include:
TIP: You can also manage your script through the Qubit CLI.
Select Settings from the side menu and then Edit in the *Prescript** card.
Make sure that you've selected prescript.js from the side menu:
Make the required changes and select Save You can now return to the previous page by selecting X in the top-right hand corner
TIP: For some examples of how the prescript can be used, see Code examples.
INFO: To publish your changes, you will need to review and apply them.
When you or a member of your team has made changes to the prescript, those changes need to be reviewed and applied before they can be published. We'll notify you when there are changes ready for review.
In the following example, we see that there are unpublished changes and that the changes were made on October 17:
To review those changes, select Review and apply changes
So you can see what has been changed, we display a diff. In the following example, we see that a change was made on line 10:
Enter a reason for the change. Be as descriptive as possible to help other team members understand why the change was made
Select Publish
So you and your team can keep track of changes to the prescript, we provide a revision history that you can browse through.
To view the changelog, select Revision history. In the following example we see that there have been 4 revisions:
You can now select a revision to see the changes in a diff and the reason. Select Previous revision and Next revision to cycle through the changes. To return to the revision history, select Revision history