When people leave, ask them where they're going, and where they heard about them.
Etc. Are you going to get acurate and complete data? No to both. But you might get actionable data. Will you get real-time feedback? Nope.
Attribution is a notoriously tricky issue and it's only getting harder with GDPR and browsers making changes to cookies.