Rich-text Reply

Custom events with values

rafael 08-28-14

Custom events with values



It seems like there's a revenue event which I can tell the value of a given action. However, it seems like it's oriented towards revenue. Isn't there a more generic event? I'd like to use the time a user took watching a video as a goal.

Level 2

siherron 08-29-14

Re: Custom events with values

[ Edited ]

Hey Rafael,


Your message is pretty vague.


You can create custom JavaScript events in Optimizely - this article should help you accomplish that:


If that doesn't help, perhaps you could provide some examples of what you're trying to achieve.


Hope that helps? 

Simon Herron
Optimisation Consultant
Level 2
rafael 08-29-14

Re: Custom events with values

With custom events you can do something like:


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


However, I'd like to do something like: 


    window.optimizely.push(["trackEvent", "eventName", 350]);


where 350 can be any number. i'd like to have a goal on how long a person watched the video. That's sort of like the revenue goal, but with seconds instead of cents. I'd like to test if the average time watching a video increases or decreases based on some change to my site. Am I making myself more clear now?

Level 2
emurphy 07-31-15

Re: Custom events with values

I would like to do something similar, but have the value be either a javascript object or a string.

window.optimizely.push(["trackEvent", "eventName", {"state":"CA","city":"Acton"])


window.optimizely.push(["trackEvent", "eventName", "CA:Acton"]);;
Level 2