I’m trying to track traffic from whatever page my users are on PRIOR to hitting my webflow site. For example: if they navigated to my homepage following a visit to Facebook, then filled out a demo request, their source would be “Facebook.”
I’ve created a hidden referral field and added relevant code but the only tracking information it is recording is that users were on my homepage prior to filling out a form. My company URL is what is showing up in the referral information.
Help!
Fairly certain you can use ‘document.referrer;’ for this, use javascript to set your hidden referral field to that value. However people would need to link directly to the contact page for this to work. Alternately you could use session storage to save this value on first visit and then set the value on your hidden field when the user navigates to the contact page.
@webdev Confusing read due to all the naming, but it’s suggesting that core browsers will provide the origin url exactly like OP requested? My tests across devices and browsers confirmed this too. How long for is anyones guess but it works.