Recording Iframes

SessionStack works seamlessly with iframes.

Same Domain

If you have iframes, that are running in the same domain as your web page, SessionStack will automatically record them without any additional work on your side.

Different Domain

If your site has a lot of iframes loaded from different domains, and you want them all to be recorded in the same session, you need an additional SessionStack snippet for your cross-domain iframes.

The reason is that browsers don't allow access to cross-domain iframes, which means that SessionStack cannot record them out of the box unless some additional effort is made:

In each cross-domain iframe you need to insert the same snippet that you have placed on your main page, with an additional isIframe: true flag:

!function(a,b){var c=window;c.SessionStack=a,c[a]=c[a]||function(){
c[a].q=c[a].q||[],c[a].q.push(arguments)},c[a].t=b;var d=document.createElement("script");
d.async=1,d.src="https://cdn.sessionstack.com/sessionstack.js";
var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(d,e);
}("sessionstack", {
    "token": "your_project_token",
    "isIframe": true
});

This additional flag tells SessionStack that the iframe should record itself and be a "child" to the outer page that is also running SessionStack, so they show up together in a single recording. Again, this is only necessary if the iframe is cross-origin with respect to the outer page.