Rich-text Reply

Total Revenue snippet

citizenc78 04-26-16

Total Revenue snippet



I've added the code <script>
window.optimizely = window.optimizely || [];
window.optimizely.push(['trackEvent', 'Purchases', {'revenue': valueInCents}]);

to my confirmation page on my site but I'm not getting any revenue details.  Can anyone help with what is wrong?

Amara 04-27-16

Re: Total Revenue snippet

Hey There,


Thanks for your question. Can you confirm that A) You have installed the optimizely snippet on the page that you are trying to track revenue? B) You have added the logic that governs the purchase amount value? That is the valueInCents part of the code?  


So for example,


var valueInCents =1000;  //notice this 
window.optimizely = window.optimizely || [];
window.optimizely.push(['trackEvent', 'Purchases', {'revenue':valueInCents}]);


If not, the code won't do anything. Does this make sense?


Feel free to post more details so one of us can help you if you have more information for us.





Teja Shah
Technical Support Representative
citizenc78 04-27-16

Re: Total Revenue snippet

I installed the optimizely snippet. I did not include the valuecents. Would using the code that you provided work then or would I need to make any further amendments?