Hi, I am interested in adding intercom to my editor x site and I have the ability to add the code to the body tag from the "custom code" page in settings but I can only add code for "visitors" as I can't seem to figure out how to pass user data to that code script. Have you every worked with something like that? Here is the code snippet:
<script> window.intercomSettings = { api_base: "https://api-iam.intercom.io", app_id: "jtdfqth6", name: "<%= current_user.name %>", // Full name email: "<%= current_user.email %>", // Email address created_at: "<%= current_user.created_at.to_i %>" // Signup date as a Unix timestamp }; </script> <script> // We pre-filled your app ID in the widget URL: 'https://widget.intercom.io/widget/jtdfqth6' (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/jtdfqth6';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})(); </script>
Hi Seth,
I would recommend taking a look at this documentation for communicating with an HTML element from the page using Velo: https://www.wix.com/velo/reference/$w/htmlcomponent/postmessage Best, Eitan