If you use a chat widget, Tend will normally be able to pull in the email address entered in an email field into that widget.
However, if a widget is loaded within an iframe, as Intercom's is, then that widget isn't really be loading on your site so Tend won't be able to grab the email as a default.
But there are a couple of workarounds to automatically capture emails entered into Intercom chat windows.
The first step will be to send the Tend fingerprint (saved as an a_id
cookie), to Intercom as a custom attribute.
Update your intercom tracking script with the following:
<script>
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
window.intercomSettings = {
tend_fingerprint: getCookie('a_id'),
app_id: 'prvhby9h'
};
</script>
The getCookie
function is used to pull the Tend fingerprint (ie a_id
) from the visitor's browser. Then we pass the fingerprint to Intercom with the tend_fingerprint: getCookie('a_id')
line.
In Zapier, create a new Intercom Lead Added to Email Trigger. When testing, you should see the fingerprint in Intercom's response (as shown in the example below).
Then, create a Tend Create Contact action, passing both the visitor's email, as well as their fingerprint
Get the visitorID and details from Intercom with an AJAX call: https://developers.intercom.com/v2.0/docs/intercom-javascript#section-intercomgetvisitorid
Within the API's response push the data to Tend using TendID.