Advertisement
ivan_carrotquest

events

Mar 15th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(!carrotJsEvent) {
  2.   var carrotJsEvent = function () {
  3.     window.addEventListener('message', function(e) {
  4.         if (e.data.comand == 'carrotquest.track') {
  5.           carrotquest.track(e.data.name,e.data.parametr)
  6.         }
  7.         if (e.data.comand == 'carrotquest.identify') {
  8.           carrotquest.identify(e.data.props)
  9.         }
  10.         if (e.data.comand == 'carrotquest.trackMessageInteraction') {
  11.           carrotquest.trackMessageInteraction(e.data.id, e.data.type)
  12.         }
  13.         if (e.data.comand == 'carrotquest.close_popup') {
  14.           document.getElementById('carrot_frame').remove();
  15.           document.getElementById('cq-popup-js-bg').remove();
  16.         }
  17.        
  18.     })
  19.   }
  20.   carrotJsEvent();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement