Jump to content

Integrating Olark's visitor API into IPS


Stephen Geppi

Recommended Posts

Posted

Hi there IPS community! I'm looking for what the variables are and how to echo them for the currently logged in user's display name and their email address so that I can send it to Olark. If anyone has done Olark's visitor API integration before your assistance is greatly appreciated. Really, all I need to know is what the variables are and how to echo username and email.

Thank you.

Posted

EDIT: I've found how to do it. Make a new custom block in your AdminCP, use PHP as your language, and enter this code:

require_once( './init.php' );
\IPS\Session\Front::i();
$member = \IPS\Member::loggedIn();
?>
<script>
  olark('api.visitor.updateFullName', {
    fullName: "<?php print htmlspecialchars($member->name, ENT_QUOTES); ?>"
  });
  olark('api.visitor.updateEmailAddress', {
    emailAddress: "<?php print htmlspecialchars($member->email, ENT_QUOTES); ?>"
  });
</script>

Hopefully this will be of assistance to anyone who needs it.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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