Ask HN: How to get referrer source of iframe parent page?

https://news.ycombinator.com/item?id=7773808
by jrod2121 • 12 years ago
2 2 12 years ago

I'm looking to place to iframe a form into a page, and when someone lands on that page and enters their information into the form, I want to grab the referrer source.

For example: I embed the iframe onto website.com/contact. The URL of that page gets posted to Facebook. Someone clicks the link, lands on the page, and enters their information into form. I then want to be able to say, 1 referral came from Facebook.

I tried using $_SERVER['HTTP_REFERER'], but this just returns the parent page URL of where the iframe form is embedded, which I don't want. I want the actual URL of the referral to the parent page (in the example above, it would be Facebook). Is there anyway to grab this information?

Related Stories

Loading related stories...

Source preview

news.ycombinator.com