I currently use inbound tracking links to websites which change the phone number displayed on the site with javascript. For example if a visitor follows "/[login to view URL]" then a unique phone number is displayed on the website just for AdWords. This already works fine.
What I need now is for these same links to also populate a hidden HTML form field so that if a visitor follows this link to the site and then uses the Contact Form, a hidden field sends "Referred by Adwords" to the recipient.
So if visitor follows link [[login to view URL]][1] and then sends a message through the HTML form, a hidden form field will transmit "Referred by AdWords" in the message. There will be several different referral sources and one default for when a tracking link is not used.
This must use javascript with a 24 hour cookie. No database required. No server side scripting allowed. I imagine this will work by having a .txt file in the site with entries like this.
[[login to view URL]][2] | Google
[[login to view URL]][3] | Microsoft
[[login to view URL]][4] | Whatever
Any method is fine so long as it is simple enough to use and reliable.