In order to successfully integrate tracking for your GoHighLevel (GHL) website that has a Stripe connected as payment provider, you will need to set up your system by the instructions in the Quick setup section on your dashboard and then configure tracking for clicks and conversions by following the guide below.
This method can be used when lead form is part of the checkout flow in GHL.
After completing the below instructions, the integration is connected with Stripe app attribution using email address of the user.
Integration steps
Install Trackdesk Stripe App
Our Stripe app is available here in the Stripe marketplace - https://marketplace.stripe.com/apps/trackdesk
Fill in all necessary information to the settings of the Stripe app and Save changes.
Tenant ID - Find your Tenant ID based on the article here
Personal token - Personal tokens can be found at the bottom of the Settings page, section Integrations, subsection Personal Tokens
Set up tracking of clicks
Track clicks by including the following code on every page of your website where you want to track clicks, including all landing pages added to an offer. For best results, position the code as high as possible within the<head>
tag of your HTML document.<!-- 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('YOUR TENANT ID', 'click');
</script>
<!-- Trackdesk tracker end -->Make sure to replace YOUR TENANT ID with your actual Tenant ID.
<!-- Help script save External CID on form confirm start -->
<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");
(function() {
function attachFormBtnHandler() {
document.querySelectorAll('.form-btn').forEach(function(formBtn) {
if (!formBtn.dataset.listenerAttached) {
formBtn.addEventListener('click', function() {
setTimeout(function() {
try {
var emailInputs = Array.from(document.querySelectorAll("input[name=email]"));
emailInputs.some(function(input) {
if (/\S+@\S+\.\S+/.test(input.value)) {
if (typeof trackdesk !== "undefined") {
trackdesk("YOUR_TENANT_ID", "externalCid", {
externalCid: input.value,
revenueOriginId: "YOUR_REVENUE_ORIGIN_ID",
});
return true; // Exit the loop early if a valid email is found
} else {
console.error("Not available.");
}
}
return false;
});
} catch (e) {
console.error(e);
}
}, 1000);
});
formBtn.dataset.listenerAttached = true; // Mark the button as having a listener attached
}
});
}
// Use a MutationObserver to watch for changes in the DOM
var observer = new MutationObserver(function(mutationsList) {
mutationsList.some(function(mutation) {
if (mutation.type === 'childList') {
attachFormBtnHandler(); // Re-run the handler attachment logic when new nodes are added
return true; // Exit the loop early after processing a mutation
}
return false;
});
});
// Start observing the document body for changes
observer.observe(document.body, { childList: true, subtree: true });
// Initial run to attach handlers to any existing form buttons
attachFormBtnHandler();
})();
</script>
<!-- Help script save External CID on form confirm end -->Make sure to replace YOUR_TENANT_ID with your actual Tenant ID.
Make sure to replace YOUR_REVENUE_ORIGIN_ID with your Revenue origin ID, you can find this value in the Settings of your affiliate program, at the top of the page, button Your Trackdesk identifiers.
Testing Your Integration
Please remember to test the creation of clicks and conversions before starting your program. This way you can verify that tracking has been set up correctly. You can create a test click and conversion by following the steps described here.