External Referral Event
See where your website visitors are coming from! Create a custom event for every referral to your website from an external domain.
// Run on page load.
window.addEventListener('load', () => {
// Check if a referrer is set and is for a different host.
if (document.referrer && new URL(document.referrer).host != location.host) {
// Add a custom event similar to a page view for external referrals only.
window.send2crm?.analytics?.setCustomEvent('EXT_REFERRED', {
href: location.href,
referrer: document.referrer,
});
}
});
Optionally, create an automation to record this event as a highlight.