--- title: "Install Gainsight PX in IFrames" slug: "install-gainsight-px-in-iframes" updated: 2026-11-23T12:30:11Z published: 2026-11-23T12:30:11Z canonical: "support.gainsight.com/install-gainsight-px-in-iframes" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.gainsight.com/llms.txt > Use this file to discover all available pages before exploring further. # Install Gainsight PX in IFrames This article explains the procedure to install Gainsight PX in iFrames. ## Overview Gainsight PX support IFrame under the following setup modes: - Application that uses multiple IFrames and controls all of them ({ "iframeModeEnabled": true }) - Application is running as a tenant IFrame under a different application ({ "iframeModeEnabled": false }) ### Application with Multiple IFrames In case your application is using multiple iFrames you should install the **standard tracking tag** in every iFrame. The tracking tag will detect the iFrame mode and will automatically adapt the tracking strategy. In this scenario, the iframeModeEnabled flag is defaulted to true and hence not required. ### Application is Running as a Tenant IFrame Under a Different Application In some cases your application is running as a tenant iframe under a different top level application which you have no control and cannot install the tag there (i.e. an Iframe app in Salesforce.com). In this type of scenarios you will need to install a modified version of the tag, with iframeModeEnabled flag set to false as follows (highlighted in green): When using the script below - please update the product key (AP-XXXXXXXXXXXX-2) to the actual key you are using! ```plaintext // Global function to initialize Gainsight PX function initializeGainsightPX() {    if (this.isGainsightPXInitialized) return;        // Gainsight PX Tag    (function (n, t, a, e, x) {          let i = "aptrinsic"; n[i] = n[i] || function () {            (n[i].q = n[i].q || []).push(arguments)        },        n[i].p = e, n[i].c = x;                let r = t.createElement("script");        r.async = !0;        r.src = a + "?a=" + e;                        let c = t.getElementsByTagName("script")[0];        c.parentNode.insertBefore(r, c);    })    (window, document, "https://web-sdk.aptrinsic.com/api/aptrinsic.js", "AP-XXXXXXXXXXXX-2", { "iframeModeEnabled": false } );    // End Gainsight PX Tag            this.isGainsightPXInitialized = true; } initializeGainsightPX();  // Call global init function whenever a new page is loaded ```