Tracking iframes with auto-identify script

Rune Juul-Stokholm Updated by Rune Juul-Stokholm

Tracking 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 because Google Tag Manager strips data parameters:

<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>

How did we do?

Tracking SPAs (Single Page Applications)

Tracking using Sleeknote or Drift

Contact