- Set up click goals in an iFrame
If you're running an experiment on page that displays an iframe, you can track click goals inside the iframe as long as you have access to the site that is being loaded in the iframe. You'll need to add the Optimizely snippet to all the web pages your experiment is running, including the iframe web page.
Set up a click goal in an iframe
Setting up a click goal for an element in an iframe is similar to setting up a click goal for a redirect variation. You'll specify the iframe URL when you set up the click goal to make sure that the goal will be properly tracked. Here's how:
Select the experiment where you want to create the click goal. In the Experiment Details panel, click Editor.
Select an element within the iframe where you want to track clicks. Select Track Clicks > Create New Click Goal from the menu.
If you can't target the element, enter the iframe URL in the URL used for preview below field located beneath the goal name: