How to get client domain name or URL which display my website as an iFrame

Hi everyone! I provide my service as an IFrame. I want to get the URL of the clients who use my service as an iframe on their website. For iFrame tracking, I am using Matomo tagmanager, can you please guide me how can I see which clients are using my service as an iFrame?

Any help would be appreciated. Thanks!
@Lukas

To know if you are in an iframe or not (if I understand well your need), you can test in JavaScript:

window.parent == window

if this is true, you are not in a frame…

I am using tag manager for iframe tracking, I can get {{page.URL}}, {{page.origin}}, {{page.host}} etc but these all points to my domain i.e., Original website however, I need the url or domain name of the website which display my site as an iFrame.

For example my website is A and there is another site B which is displaying my site A as an iFrame in B site, and I want to get the URL of B or C or D i.e., all the other sites which are displaying my site as an iFrame in their site. Hope it is clear now? :slight_smile:

Anyone please suggest me any solution for the above scenario. I am still waiting for it. Thanks!
@heurteph-ei @Lukas

To prevent cross site scripting, you cannot get information from parent frames (or parent window in term of JavaScript)
BUT:

  • you can define if you are inside a frame or not with the code provided above
  • The referrer should be the site hosting the iframe…