What is Custom JS?

Custom JS is basically lines of Java script codes that can be added to perform a specific function. By default, the process of segmentation allows segregating users based on multiple conditions or segment types. But in order to group specific users using any other factors other than the already provided attributes, users can write Custom JS to perform the action. 

1. Login to Admin Portal.

2. Select your Application from the left panel.

3. Click Manage Application.

4.  Click Custom JS

5.  Enter the custom script for the appropriate environments.

    Custom JS contains two scripts:

User Segmentation JavaScript: JavaScript that is executed to collect the data needed for Segmentation ie, for identifying the user and creating segments
Application Level JavaScript: JavaScript to customize the application behaviour at a DOM level

6.  Click Save.


The saved java script runs in the back end and the returning keys can be used in segmentation or other functions.

Publishing Custom JS

Once you save the script, it should be published so that the code becomes available in the required application.

To publish:

1.  From the Manage Current Application page, click the ellipsis icon.

2.  Select the Environment that needs to be published.

3.  Click Publish Latest.