How Consent Studio assists you in handling inline frames (iframes) on your website
We have built some features that can help you with iframe dynamics between domains that share the same top level domain.
Challenges
1. Handling iframes inside your domain's pages
There are scenarios imaginable in which you want to reload inline frames (iframes) on your website when the consent state that is collected by the Consent Studio banner is updated.
2. Hiding the consent banner when being loaded inside of an iframe
Another scenario is when any of your domain's pages is loaded inside of an iframe, you may sometimes want to hide the consent banner that would otherwise display on that page.
Example scenario
Imagine that you have a top level domain and a subdomain that both have the Consent Studio consent collection banner installed. These domains can both operate independently, but the top level domain also embeds certain content from the subdomain. In this scenario, you would have two consent banners shown to first time visitors β one on the top level domain and one more inside the iframe. The challenge is to (1) make sure that only one banner is shown and (2) to make sure that consent is still respected on the domain that is loaded by the iframe.
Hiding the consent banner when being loaded inside an iframe
By enabling the Hide banner in iframe windows option inside the Advanced tab of the General Settings panel in the Consent Studio dashboard, you will make sure that the consent banner does not pop-up when a specific page is loaded inside an iframe window.
The toggle for the consent banner will also be hidden on this page.
You will rely on (a) existing consent or (b) consent collected on another subdomain, given that you have enabled the Share Consent Studio cookies with all subdomains setting in the Consent Sharing tab of the General Settings panel in the Consent Studio dashboard.
More details about cross subdomain consent sharing can be found in this article. More details about how Consent Studio handles subdomains can be found in this article.
Reloading iframes when the consent state is updated
Especially when you have hidden the consent banner on another domain in cases when it is loaded inside a subdomain, you will rely on the domain that actually holds the iframe to collect consent β assuming that it has the same top level domain. In these cases, it is useful to automatically reload the iframes so that they can propagate the latest consent state.
By enabling the Reload iframes on consent state update setting inside the Advanced tab of the General Settings panel in the Consent Studio dashboard, you will make this happen.
All iframes will be reloaded on the page. Not just the ones that already have consent checks built into their source loading.