Form tracking: iframes (auto-identify script)
In this article, we'll show you how to track iframes using auto-identify script.
Adding iframes with auto-identify script
- 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>
- 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>
- 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>