Post by ibrunomaciel » Tue Jun 21, 2016 10:30 pm

Hello!

Im trying to add Intercom chat to my logged-in costumers but I need help to find the php vars of:

Firstname
Email
Registered Date

These details was not in any php vars or cookies on all pages of client panel?

Newbie

Posts

Joined
Fri Aug 07, 2015 7:07 pm

Post by straightlight » Wed Jun 22, 2016 1:12 am

The intercom API does not use any local php vars nor cookies due to the enforced oAuth encoding protection throughout their system. In order to re-track an existing user in intercom, you need to use a provided token while calling intercom systematically and then view the related user ID and the email address.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ibrunomaciel » Wed Jun 22, 2016 1:40 am

See the Intercom code for already-costumers:

Code: Select all

<script>
  window.intercomSettings = {
    app_id: "MY_APP_ID",
    name: "<?php echo $current_user->name ?>", // Full name
    email: "<?php echo $current_user->email ?>", // Email address
    created_at: <?php echo strtotime($current_user->created_at) ?> // 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/q6151jm5';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 need the Firstname + Email + 'account created time' of my clients when they are online and logged on my OC store, understand?
Sorry for my bad english.

Newbie

Posts

Joined
Fri Aug 07, 2015 7:07 pm

Post by straightlight » Wed Jun 22, 2016 3:29 am

I would suggest to contact the developer of the extension you're using or to contact intercom for more information on your request.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 1 guest