Rich-text Reply

How to track events when URLs are masked

jonsilcomp 02-27-17

How to track events when URLs are masked

We have a 3 part signup form (create account, add billing, add payment details), but because we use URL masking the URL doesn't change as you walk through each step. When I load our /signup page in Optimizely X event builder, it only shows the 1st step in the 3 steps. How can I get Optimizely to display steps 2 and 3 so I can track each step?

santhony7 02-27-17
 

Re: How to track events when URLs are masked

It sounds like you will either have to make your page activate by some other event Activation Mode or just activate your whole experiment when a user clicks "next step" or whatever.

https://developers.optimizely.com/x/solutions/javascript/reference/index.html#function_activate
Anthony Smith
JasonDahlin 02-27-17
 

Re: How to track events when URLs are masked

If your page reloads but keeps the same URL, then URL based PageView goals will not work. But, presuming you have a way of reading the DOM to figure out which page the user is on, you can add to the page that reads the DOM and sends the "event" to Optimizely after page load. See here for more info:
https://help.optimizely.com/Measure_success%3A_Track_visitor_behaviors/Custom_event_goals_in_Optimiz...

If your page does not reload, then you will need the page to send your some sort of trigger that lets you know when it has updated to the next page (or build out a function that works with ajaxComplete() to identify when the page has updated and then read the DOM to see which page the user is now on and then trigger the event).
--Jason Dahlin
Analytics and Testing Guru Smiley Happy
jonsilcomp 02-27-17
 

Re: How to track events when URLs are masked

The page isn't reloading. For reporting, we are using analytics.js to send us events when users reach certain stages (all the data collected through segment.com). Need to figure out a way to leverage those same events here.
JasonDahlin 02-27-17
 

Re: How to track events when URLs are masked

[ Edited ]

(edit)

 

In order to send data to segment.com, you need to run code that looks like this when certain events happen:

analytics.track(event, [properties], [options], [callback]);

To send the data to Optimizely at the same time, you need to add code that runs at the same time, like this:

window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "eventName"]);

Here are a couple of articles in the Knowledge Base that talk about how to create Custom Events:

https://help.optimizely.com/Measure_success%3A_Track_visitor_behaviors/Custom_event_goals_in_Optimiz...

 

https://help.optimizely.com/Measure_success%3A_Track_visitor_behaviors/Events%3A_Tracking_clicks%2C_...

 

--Jason Dahlin
Analytics and Testing Guru Smiley Happy