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
  1. Install the same tag with Session Replay 2.0 enabled in both windows.
  2. 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"],
        ...
    });

Select a question to find a solution.

The page content in the recording may be different from the actual content. It's likely that the CSS on the site frequently changes. In this case, add the content hash to the style file names. Then, when you change the file's content, its name will change. For example: style.390b32d4d49d5e7d.css will be changed to style.0c573d460df87d4de5a4.css. This lets Session Replay use the style that the site visitor sees when it records a session.

Do the following:

  • Clear the browser cache.
  • Disable all plugins and browser extensions.
  • Delete browser cookies.
  • Check the firewall settings. The firewall may be blocking the Yandex Metrica tag script. The tag could also be blocked by the extension Adblock Plus.

If you have more questions about Session Replay, submit them in the form below. Provide an example of the session where data was displayed incorrectly and specify the full version of your browser.