Using the Visual Editor, you can add custom JavaScript to an experience that can be run alongside message or without them. Experience JavaScript added in the dropdown will run before messages render, so messages can access any global variables and functions initiated in the dropdown.
Get Started
If you haven’t already, open any page of your website, click the Evergage logo
to the right of the address bar in Chrome, and click the Visual Editor slider to enable itThese instructions are for version 53.9 or later of the Evergage Visual Editor. If you do not see the Evergage logo or have the latest version, please see Install and Open the Visual Editor for instructions.
- Create or edit a campaign
View Source Code
You can access message source code in an expandable area in the bottom of the page. After you click Apply, code changes are immediately reflected in the campaign so you don't need to close the window to preview the changes.
- Select at the bottom left of the window
On the Experience JavaScript tab, you can enter JavaScript that will apply for all messages in the experience
Example
If you want to run custom validation with JavaScript before displaying messages, you could use Experience JavaScript to stop displaying all messages associated with the experience. Using the code below, the beacon will not show any messages in this experience if "#somePageElement" is visible.
if ($('#somePageElement').is(':visible')) { return false; }
- Change the background from light to dark or dark to light by clicking
- Click Keyboard to view a list of 8 keyboard shortcuts (shown at right)
Click Run to view the changes in action
- Click Apply to apply the changes to the message or experience
This page has no comments.