Sponsors

Integrating SPI & 3rd party leads capture

Kyle Deneen, 11-04-2008
Integrating SPI leads capture along with a 3rd-party leads system into your website is a fairly simple process. Some 3rd-party systems such as AWeber and Lyris use a form-based method for acquiring leads from your opt-in forms. SPI leads capture uses a cURL-based PHP function call to accomplish this.

Imagine the following scenario: Your company has a webpage with an opt-in form that asks a user to provide their name and email address. You want to save this information in both your SPI Leads Manager and in a 3rd-party system. Lets assume your opt-in form resides on 'index.php' and that once leads are added you want the user to end up on 'index2.php'. You could integrate form-based 3rd-party leads capture as well as SPI leads capture in the following way:

1. First determine the needed vars for the 3rd-party system. These are usually hidden input tags that should be submitted along with the leads data such as name and email address. Generally, the 3rd-party site should contain directions on which vars are needed to add a lead and where to submit that info.

2. Create a page in between index.php and index2.php where the lead processing will take place. Lets call this page 'subscribe.php'. You would point your opt-in form action on index.php to POST to subscribe.php.

3. To add a lead to your SPI Leads Manager, the following code would be placed at the top of subscribe.php:


<?
// include the functions/data config for your shoppingcart
require_once("spicart.php");

// set data from POST
$name = $_POST['name'];
$email = $_POST['email'];

// set up the $input var to add the lead
$input = array();
$input['name'] = $name;
$input['emailaddress'] = $emailaddress;

// if you wanted to add this lead to an autoresponder, you can do this
// to specify which one. It's based on the autoresponder_id in your SPI
// account for an existing autoresponder
$input['autoresponders'] = 2;

// call the SPI Shopping cart 'do_addlead' API function passing $input
do_addlead($input, $output, $ResultStr);

?>

4. The next step is to create a simple HTML document that will contain a form and all the necessary vars to pass to the 3rd party system.


<html>
<
body onLoad="javascript:document.forms['lead'].submit();">
<
form action="http://www.3rdpartyleadssite.com/addlead.php" method="post" name="lead">
<!--
in this section you add the needed inputs for the lead to be successfully
added to the 3rd party system
. In this example, needed inputs for Lyris leads capture.
--> 
<
input type="hidden" name="name" value="<?=$name?>">
<
input type="hidden" name="email" value="<?=$email?>">
<
input type="hidden" name="list" value="your_list">
<
input type="hidden" name="name_required" value="T">
<
input type="hidden" name="confirm" value="one_hello">
<
input type="hidden" name="showconfirm" value="F">
<
input type="hidden" name="url" value="http://www.yourdomain.com/index2.php">
</
form>
</
body>
</
html>

Obviously, the names and values of the inputs you need for your 3rd party system may differ. Integration instructions for the 3rd-party site should tell you the proper place to point the form for their system to pick up the data. The 'onLoad' event in the tag tells the browser to simply submit the form when the HTML loads. PHP is processed first, so the lead is initially added to SPI Leads Manager, and then the form is submitted to the 3rd party site. Most 3rd party sites allow you to specify a URL that their system will redirect your user to once their system adds the lead.
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.

About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions  |  Affiliates  |  WebMail

© 2008 Software Projects Inc. (SPI) 2
Wednesday, January 7th, 2009