BECOME A POWER-USER 🏆 Maximize the full potential of WhatConverts! Learn more
When a form is embedded using an iframe from a different domain, the form is actually hosted somewhere else, either on the same domain or with a third party provider on an external domain.
You can follow the instructions below to track your iframe form with WhatConverts. Alternatively, once you've ensured your tracking script has been added to the source of your iframe (using a custom code element or code injector in the form builder), you can contact WhatConverts support to deploy the additional scripting within the tracking scripts themselves.
If your form is hosted within the same domain, make sure your WhatConverts tracking script is on the page that is serving the form.
If your form is hosted by a third party provider, a browser security measure called "same-origin policy" prevents the WhatConverts tracking script from accessing the content of the iframe. To circumvent this and track forms in the iframe, follow these steps:
1Add the following to the page where your form is hosted. This will be the third party provider, like Formsite, Pardot, etc.
This script identifies the parent URL where you have put your form. Replace https://YourURL.com/ with your site's URL.
<script type="text/javascript"> wc_frame_parent = 'https://YourURL.com/'; </script>
Below this script, paste your WhatConverts tracking script.
2Add one of the following JavaScript functions to the page on your site where the iframe is being initiated using the ID, name, class or role of the Iframe above or before your WhatConverts tracking code on your site.
Note: If you haven't added your WhatConverts tracking script to your website, add your tracking script. If you are using the WhatConverts WordPress plugin, you will want to deactivate the plugin and place your WhatConverts tracking code below one of the following codes.
Iframe Name: Replace iframe_test with the name attribute.
<script type="text/javascript">
wc_frame_target = '[name=iframe_test]';
</script>
Iframe ID: Replace iframe_test with the ID attribute.
<script type="text/javascript">
wc_frame_target = '#iframe_test';
</script>
Iframe Class: Replace iframe_test with the class attribute.
<script type="text/javascript">
wc_frame_target = '.iframe_test';
</script>
Iframe Role: Replace iframe_test with the role attribute.
<script type="text/javascript">
wc_frame_target = '[role=iframe_test]';
</script>
Below is an example of how to find an iframe ID attribute.
The ID of the iframe above is frame-one458908311.
If you have any questions, please contact WhatConverts Support or email support@whatconverts.com
One of our marketing experts will give you a full presentation of how WhatConverts can help you grow your business.
Schedule a DemoWhatConverts allows you to pick and choose which forms you would like to track on your site.
We make form tracking easy in Google Analytics, providing complete lead information and marketing data.
Instantly track and follow-up with leads that contact you through web forms.
See leads in your inbox instantly.