Knowledge Base/Advanced Features: Automations/Drip Campaigns

Capturing Email Addresses Submitted with 3rd Party Forms into BombBomb Drips

Matt Ahern
posted this on Feb 01 13:37

Capturing Email Addresses Submitted with 3rd Party Forms into BombBomb Drips

Add this script to your web page that contains your form; somewhere in between the <body>....</body> tags.

<script type="text/javascript">
function sendtodrip() 
{     var dripemail = document.getElementById("fields_email").value;
    var dripurl = "http://app.bombbomb.com/app/api/api.php?method=addToDrip&d=b378..."+dripemail;
    document.getElementById("dripimg").src = dripurl;
    while(document.getElementById("dripimg").completed); } </script>

The dripemail Variable

Replace the " fields_email" found in the first line with the variable of the email field in your form. In this example it is, fields_email.

 

Look for the email field in your form and find the ID for that field. For example,

<input id="fields_email" type="text" />

 

The ID of this field is id="fields_email". That is the variable name you want to add to the var dripemail = document.getElementById("fields_email").value; line. If the email field of your form has an ID of "emailaddress", such that:

<input id="emailaddress" type="text" />

 

You would build that line of the script as such;

var dripemail = document.getElementById("emailaddress").value;

The dripurl Variable

Get the HTTP Request code from your drip's embed page. Click the Embed button on your drip and copy the HTTP Request code.

drip-embed-httprequest-add-loc.png

 

Replace the contents of the dripurl with the HTTP Request code minus the EMAIL_ADDRESS part of the code.

The example shown,

var dripurl = "http://app.bombbomb.com/app/api/api.php?method=addToDrip&amp;
d=a0b1c2d3-e4f5-e6d7-c8b9-a8b7c6d5e4f3&amp;e="+dripemail;

 

Replace the http://app.bombbomb.com/app/api/api.php?method=addToDrip&amp;d=... part with your HTTP Request embed code minus the EMAIL_ADDRESS part.

The Tracking Pixel

Add this blank image anywhere as it appears here.

<img id="dripimg" height="1px" width="1px" />

Connecting Your Form to the Drip

Add onclick="sendtodrip()" to the submit <input> element. If you already have the onclick event added to the submit input tag, then add a semicolon after the JavaScript function and add the sendtodrip();. For example,

 

If your submit looks like this;

<input id="submit" name="submit" value="submit"
type="submit" onclick="myJavascriptFunction();" />

 

Change it to:

<input id="submit" name="submit" value="submit"
type="submit" onclick="myJavascriptFunction();sendtodrip();" />

 

Your form with the BombBomb drip capture command;

<form method="post" action="http://where-to-send-the-info-collected-from-the-form.php"
name="myform" id="myform">
    <p>First Name:</p>
    <p>
        <input id="fields_fname" border="0" type="text" />
    </p>
    <p>Last Name:</p>
    <p>
        <input id="fields_lname" border="0" type="text" />
    </p>
    <p>Email:</p>
    <p>
        <input id="fields_email" border="0" type="text" />
    </p>
    <input id="submit" name="submit" value="submit" type="submit" onclick="sendtodrip()"/>
</form>

 

Add the completed script, the tracking pixel image code and the form code to your web page and save it.

Your non-BombBomb form will now send email addresses to your drip campaign.