Conditions for recording iframe content

Session Replay 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 in the parent window. If both windows have the same tag, make sure it has Session Replay 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. Place the same ad tag with Session Replay enabled in both windows.

  2. Add the trustedDomains parameter to the code snippet of the tag that was placed 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"],
    ...
    });
    

Chat with us

Write an email

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. This will make the file name change every time you update its contents. For example, style.390b32d4d49d5e7d.css will become 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 the browser cookies.
  • Check the firewall settings. It’s possible that the firewall is blocking the Yandex Metrica tag script. The tag could also be blocked by the Adblock Plus extension.
I followed the recommendations, but the error persists

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