Jump to content

Intergrating Intercom


woho

Recommended Posts

Hello guys! I need your help. I want to integrate intercom.io on my whmcs as they provide great tracking services. So I read on the net where should I place the code. So far I found a way to place the script on the "footer.tpl". So far so good, but there is a second part which is to fetch the user's name and email address once he is logged in whmcs and that's the part I need help.

 

Here is the integration script: ( javascript as php wont work in tpl file

###########################################

<script>
 window.intercomSettings = {
   app_id: "000000",
   name: "[color="#FF0000"]Nikola Tesla[/color]", // Full name
   email: "[color="#FF0000"]nikola@example.com[/color]  ", // Email address
   created_at: 1312182000 // Signup date as a Unix timestamp
 };
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/d05g7qra';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>

###########################################

I know so far that these variables would work in php {$client->fullname} and {$client->email} but what should I put there for intercom to read the name and email of a logged user using javascript.

 

Your help is mostly appreciated.

 

Thanks

Xavier

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated