Form tracking: iframes (auto-identify script)

Updated by Rune Juul-Stokholm

Please only implement the scripts below IF you are currently using the legacy version 1.0 of Dreamdata's Web Tracking script. Otherwise, we recommend using the new Web Tracking script, version 2.0, which has built-in support for form tracking, intent sources and other integrations.

In this article, we'll show you how to track iframes using auto-identify script.

Adding iframes with auto-identify script

  1. On the parent page that contains the iframe, you will need the following script added at the end of the <head /> section.
<script async id="dreamdata-form-identify" src="https://cdn.dreamdata.cloud/scripts/identify-form/v1/identify-form.min.js" data-iframe="true"></script>

  1. If you are using Google Tag Manager, then you have to use this script instead:
<script>
var script = document.createElement('script');
script.async = 'true';
script.id = 'dreamdata-form-identify';
script.src = "https://cdn.dreamdata.cloud/scripts/identify-form/v1/identify-form.min.js";
script.setAttribute('data-iframe', 'true');
document.head.appendChild(script);
</script>

  1. Within the iframe, you will need the following script added at the end of the <head /> section.
<script async id="dreamdata-iframe" src="https://cdn.dreamdata.cloud/scripts/identify-form/v1/iframe-identify-form.min.js"></script>


How did we do?