Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.

Announcement

#1 2015-08-12 16:02:28

altomarketing
Member
Registered: 2015-03-25
Posts: 34

Where should i my code to add visitors to my leads.

Hi !

I use Interspire to send newsletters, and in my website i have this code to get visitors data to add automatically to my list.

In which file do you suggest to add this code to add automatically to my list, all chat users ?

Thanks !

[== PHP ==]
//data from new customer   HERE IS WHERE LIVEHELPER SHOULD SEND DETAILS
	$first_name = $vars['firstname']; 
	$last_name = $vars['lastname']; 
    $email = $vars['email']; 
	$country= $vars['country']; // VA al campo 10
	$city= $vars['language'];    // va al campo 8

     
  
$xml = "
<xmlrequest>
	<username>{$username}</username>
	<usertoken>{$usertoken}</usertoken>
	<requesttype>subscribers</requesttype>
	<requestmethod>AddSubscriberToList</requestmethod>
    <details>
        <emailaddress>{$email}</emailaddress>
        <mailinglist>{$list}</mailinglist>
        <format>html</format>
        <confirmed>yes</confirmed>
        <customfields>
        <item>
            <fieldid>2</fieldid>
            <value>{$first_name}</value>
        </item>
		<item>
            <fieldid>3</fieldid>
            <value>{$last_name}</value>
        </item>
		<item>
            <fieldid>10</fieldid>
            <value>{$country}</value>
        </item>
		<item>
            <fieldid>8</fieldid>
            <value>{$city}</value>
        </item>
        </customfields>
    </details>
</xmlrequest>
";

	$ch = curl_init($xmlpath); //CHANGE TO THE PATH OF YOUR IEM INSTALLATION
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
	$result = ***_exec($ch);
	if($result === false) {die("Error performing request");}
	//var_dump($result); //for debugging purposes
	//Example of how to display returned data
	$xml_doc = simplexml_load_string($result);
	if ($xml_doc->status == 'SUCCESS' && empty($xml_doc->data)) {die('Status is success. Empty response.');}
	if ($xml_doc->status == 'SUCCESS') 
			{
				/*	echo 'Response: <br />';
					var_dump($xml_doc->data);
				*/
			} 
		else {
			echo 'Error is '. $xml_doc->errormessage;
	}

	
	
	
							} 

Offline

#2 2015-08-12 21:59:42

JustinUtesch
Member
Registered: 2014-04-13
Posts: 19

Re: Where should i my code to add visitors to my leads.

I don't know what kind of website you have but I wouldn't want to be added to a mailing list just because I started a chat. Seems obtrusive.

But if you really must, I would start here https://github.com/LiveHelperChat/liveh … extensions

Maybe use the sevabot extension.

Offline

#3 2015-08-13 15:27:12

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Where should i my code to add visitors to my leads.

This extension also would be a good start
https://github.com/LiveHelperChat/osTic … tstrap.php

It creates an issue once users starts a chat.

Offline

#4 2015-08-18 19:47:05

altomarketing
Member
Registered: 2015-03-25
Posts: 34

Re: Where should i my code to add visitors to my leads.

remdex wrote:

This extension also would be a good start
https://github.com/LiveHelperChat/osTic … tstrap.php

It creates an issue once users starts a chat.

Thanks !! I will share the code when i finish it.

Offline

Board footer