Search code examples
google-analyticsdata-protection

Disable analytics for iframe


The website uses embed Youtube videos, Slide Shares, Open Table Widgets that become iframes. According to the new law about GDPR we need to ask user's consent for tracking his activity. But how then I can use these components and at the same time disable analytics that comes automatically from these iframes?


Solution

  • It's very difficult to reconcile any kind of tracking with GDPR. If the frame you're loading does not provide privacy controls of its own, you would need to acquire the relevant consent before loading the iframe at all, which you can do via Javascript loaded from your own site.

    As a workaround, you could proxy the services and strip tracking cookies and scripts before they ever reach the end user. I've done this before.

    The privacy-friendly approach is to not use services that track users in the first place, and then you have nothing to worry about. Sadly this is easier said than done, since the vast majority of such services' entire business model relies on tracking people.