SPA (Single Page Application)

You can trigger an Ethnio Intercept in your SPA in a couple different ways. If you have a method of controlling when a JS (JavaScript) snippet is called, such as an advanced tag management tool that understands state, you can restrict Ethnio JS to only appear in the right state or page in your SPA. That would happen entirely on your side if you have that capability. If not, you can use Ethnio Custom Targeting to determine exactly when an intercept appears, but it takes a bit more setup so please review the steps below.

Step 1: Create Custom Targeting Filter & Variable

This requires a Pro or higher plan, but head to Screeners >> Targeting and scroll down to create a new custom targeting filter based on an external variable you'll pass to Ethnio JS called State.

mceclip0.png

 

Step 2: Add Titles & Parameters

Let's call this one "SPA State" and enter values for pages and one click behavior. Make sure to create a Title and Parameter name for the exact place in your SPA you want an Ethnio intercept to appear: 

Screen_Shot_2019-12-06_at_9.50.06_AM.png

Step 3: The Null State

This might be the most work for your developers, but it's critical Ethnio receives a Null state for every other time Ethnio JS gets pinged from your servers, regardless of whether the screeners is on or off. At the end of the list of parameters, create and pass a null state for every other state in the SPA. This ensures the intercept doesn’t show up unless it’s the exact right state.

mceclip2.png
 

Step 4: Choose State(s)

As long as Ethnio is receiving the different states via JS, you can toggle which pages or states in your SPA the intercept should appear in without changing any code. Simply click the state to toggle. Null should always be off:

mceclip1.png

Still need help? Contact Us Contact Us