Conditions for recording iframe content
Session Replay 2.0 supports the recording of content that is embedded in an iframe element. This content can be recorded if one of the following conditions is met:
- The domains of the parent and child windows are the same
-
Install a tag with Session Replay 2.0 in the parent window. If both windows have the same tag, make sure it has Session Replay 2.0 enabled.
The tag is optional in the child window, or a different tag may be installed. In this case, add the childIframe:true parameter to the code snippet of the tag that is installed in the parent window. By default, it's set to false.
ym(XXXXXX, "init", { childIframe:true, clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true, trackHash:true });
where
XXXXXX
is the number of the tag installed. - The domains of the parent and child windows are different
-
- Install the same tag with Session Replay 2.0 enabled in both windows.
Add the trustedDomains parameter to the code snippet of the tag installed in the child window.
ym(XXXXXX, "init", { trustedDomains: ["example.com"], clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true, trackHash:true });
where
XXXXXX
is the number of the tag installed.example.com
is the domain of the parent window. You can specify multiple domains by separating them with a comma. This may be useful if the parent window is hosted on subdomains.ym(XXXXXX, "init", { trustedDomains: ["example.com", "sub.example.com"], ... });