I am struggling to find a good way to track the source of traffic that brought leads to our website.
I understand that UTM parameters are the preferred method of tracking PPC campaigns, but is there an effective way to capture other sources such as organic, website referral and direct traffic? These sources don't traditionally have UTM parameters appended to them unless it's a referral source you control.
See this script I developed: MarTech/UTM-Tracking at master · yanirclsr/MarTech · GitHub
Besides storing the original and last UTM params, it also stores the original and last referral in the cookies (or local storage).
You can then capture them into your forms very easily.
Feel free to comment here if you need further help.
This is very interesting. How would this collect the UTM tracking of the newer formats such as the advanced tracking in AdWords?