Skip to main content

ClickFunnels Email Attribution

Sasha Gerold avatar
Written by Sasha Gerold
Updated over a week ago

For integration with ClickFunnels and specifically email attribution for leads, please follow the guide below.

This is for the connection of email form when ClickFunnel is used (so that e.g. Stripe can then be used for the email attribution).

Before any steps can be completed, you must first create a funnel.

In Clickfunnels, navigate to Settings.

To track clicks, include this code on every page of your website where you want to track clicks, including all landing pages added to this offer.

<!-- Trackdesk tracker begin -->
<script async src="//cdn.trackdesk.com/tracking.js"></script>
<script>
(function(t,d,k){(t[k]=t[k]||[]).push(d);t[d]=t[d]||t[k].f||function(){(t[d].q=t[d].q||[]).push(arguments)}})(window,"trackdesk","TrackdeskObject");

trackdesk("yourtenantid", "click");
</script>
<!-- Trackdesk tracker end -->

Make sure to replace yourtenantid with your actual tenant ID.

In Clickfunnels, it looks like this:

Then you will need a lead and help script as shown below, specifically placed on the page where user enters their email address:

<!-- Trackdesk process email and send lead for internal flow - START -->
<script>
document.addEventListener("DOMContentLoaded", function() {
let emailInput = document.querySelector("input[name='email']");

if (emailInput) {
emailInput.addEventListener("blur", function() { // Fires when user leaves the field
let emailValue = emailInput.value.trim();

// Email validation: must contain @, a domain, and a dot (e.g., [email protected])
let emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;

if (emailPattern.test(emailValue)) {
// πŸ”₯ FIRE TRACKDESK CODE 1 (Conversion Tracking)
trackdesk("yourtenantid", "conversion", {
"conversionType": "lead"
});

// πŸ”₯ FIRE TRACKDESK CODE 2 (External CID Tracking)
trackdesk("yourtenantid", "externalCid", {
"externalCid": emailValue, // Using email as externalCid
"revenueOriginId": "yourrevenueOriginId"
});
}
});
}
});
</script>
<!-- Trackdesk process email and send lead for internal flow - END -->

Make sure to replace both occurences of yourtenantid placeholder with your actual tenant ID.

Make sure to replace yourrevenueOriginId with the Revenue origin ID of your account.

How to find your Revenue Origin ID.

In Clickfunnels, it would look like this:

Then, click on 'Update Funnel.'

After the above setup, you will be ready to support email attribution e.g. via Stripe customer email attribution or a different method using attribution via emails.

Did this answer your question?