We have a website which have an iframe which is provided by a company we work with, which allows them to buy our products online.
However, the company is very reluctant to add any analytics to specific company iframes (as they all use the same code, apart from one line which changes) and they won't allow us access to the code for security reasons.
However, we are seeing a lot of people who visit the parent site (which we own) but not many, if any, products purchased - or even taken to the checkout (which we can see).
I know with Javascript we cannot see the iframe URL due to Cross Domain policy, however I was wondering if there was a way to do this with PHP.
If it makes any difference the iframe's URL is a subdomain of the parent site.
The simplest way to know, where user came from, with php it var $_SERVER - (Server and execution environment information)
$_SERVER['HTTP_REFERER'] The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.