find parent window URL from iFrame from diffferent URL

They have: 426 posts

Joined: Feb 2005

So i have an ad server and the ad code is in the form of Javascript.

If my ad code is served inside an iFrame by the publisher and the publisher then sends his iFrame to another party to serve on another website, I cannot detect this because of cross site restrictions?

But is there a way to find the parent URL? using Javascript, PHP or anything else.

If you are confused here is an attempt to put this in an image:

ad code ---->--- GIVE TO PUBLISHER ---->---- ad code in publisher iFrame --->---- PUBLISHER GIVES TO 3RD PARTY --->---- 3rd party publishes on a site.