> How did you hear about us?
If you’re specifically sharing a link to Facebook you could append a string to the URL:
https://example.com/myform/?referrer=facebook
Have you form look for that $_GET value.
]]>Appending a string to the URL sounds like a good idea, but my technical know-how is blah. Do you know where I can refer to step-by-step instructions?
Thank you!!
]]>Google Analytics may also be able to pick up on the URL parameter and you may be able to filter on it with the Google Analytics reporting tools.
]]>$_SERVER['HTTP_REFERER']
is probably the best way to do what you want. Just keep in mind that spambots, hackers, etc will spoof or not send a referer header. (Those who value privacy will also not send a referer header, but such people will likely never visit your contact form page.)
If you are using hosting that includes cPanel, you could enable one of its stats applications (AWstats, Webalizer, etc) and check the reports. While the results would not be specific to your contact form page, they will provide a lot of useful information about those who are accessing your site. (Better in many cases than Google Analytics, which can be disabled by ad blockers.)
]]>