Using Appcues with iFrames
Submit Article Requests
Do you have a suggestion for an article you would like to see created?
Feel free to submit this form and add your suggestions to our document board.
- Installation & Developers
- Web Experiences
- Mobile Experiences
- Account Management
- Best Practices
- System Status
Table of Contents
Do you use iFrames in your application? Are you unable to place tooltips? No problem, we're here to show you how to work.
To follow this guide, it is best to already have:
- Installed the “iframe in new tab” Chrome extension
What Are iFrames?
iFrames, also known as Inline Frames, are essentially a web page within a web page. They're used to display other web pages on your web page whether it's for forms, media, or other material. Because they're a different web page being shown on your site, access to the original source code is needed so that Appcues can be installed to the original web page since the iFrame is not part of the source code of your web app.
- Access to the iFrame original source code.
Appcues will need to be installed into any iFrame source code that you are using in order to build within the iFrame as well as publish flows to the iFrame. The installation will be just like installing Appcues to your own web app that you have done before. Check out our installation overview here!
Building within an iFrame
Appcues will require you to separate your flow between the steps you will need Outside of the iFrame and Within the iFrame.
Important: take the time to physically draw out your experience where you encounter your iFrame. That way you can visualize what is Outside vs Within the iFrame.
Once Appcues is installed in your iFrame, you can use a Chrome Extension to open the iFrame in a new tab so you can interact with it and build flows! Download here: https://chrome.google.com/webstore/detail/iframe-in-new-tab/lkegfiagmgdnamcfdokgeobfcffnjaci/related?hl=en-US
From here, you can build a flow as normal as if you were building a flow in your web application.
NOTE: If you have a flow in an iFrame and a flow outside of an iFrame on the same page, Appcues will show both flows, due to the nature of iFrames, therefore, we recommend if you have a flow within an iFrame, to only have the flow within the iFrame
Quick iFrame Example
Below this line is a quick example of an iframe of our Docs site displaying a PIN in the iFrame
Step 1: Isolate the iFrame
This is where using the “iframe in new tab” chrome extension comes into play. You can use the Chrome Extension to open the iFrame in a new tab so you can interact with it and build any Appcues experience you desire. From this moment on you would build as you would on your web app.
If you were to right-click on the iFrame with the extension installed, you can see an option to open the iFrame in a new tab/window.
From there you can simply open the Appcues extension and build within the iFrame as much as you would like.
Step 2: Target the iFrame domain/URL
As mentioned prior, think of iFrames as a website living within another website. Each one has their own respective domain. When you use the Chrome Extension, you’ll be able to see the domain in the URL. Make sure you add the iFrame domain as available in the Account Settings to be able to choose the domain in the targeting of the Appcues experience you’re looking to publish.
1. Which URL conditions should I use in 'Page Targeting'?
As you're building content on a different URL than the parent URL, you should be using conditions that match the iFrame's URL. This will make it so that in the instance of a user reaching a page where there's technically two URLs (parent URL as well as the iFrame's URL), Appcues will attempt to trigger it based on the elements it has found on the Build URL where the iFrame is, instead of the parent URL.
See Page Targeting for more information.
2. Can I create a flow that has steps in an iFrame and outside the iFrame?
No. When building flows that are related to iFrames, it's best to separate flows from the iFrame and other pages as there isn't a smooth way for both pages to pass over information synchronously.