Matomo Opt-Out iFrame not working

Hi ,

We are using matomo 3.4.0 and trying to use Opt-Out iframe mentioned here:
https://matomo.org/docs/privacy/#step-3-include-a-web-analytics-opt-out-feature-on-your-site-using-an-iframe

but clicks are still being captured even if we opt-out and sometimes opt-out toggle is also not working.

Our site is not on matomo domain and matomo is working behind load balacer and deployed on nginx (ubuntu)

Can someone suggest what is the problem ?

Thanks.

Hi,

Is the tracked website by chance on a different domain as Matomo?
The normal opt-out iFrame loads from the Matomo domain and sets a cookie on the Matomo domain.

But that means that the cookie is a third-party-cookie and a lot of browsers block those by default therefore breaking the opt-out.

But you can use the Matomo JS API, to easily write an opt-out form that instead sets the cookie on the website domain. This means that they are only opt-out for this website and not all websites tracked by this Matomo instance, but it should work more reliable.

https://developer.matomo.org/guides/tracking-javascript-guide#optional-creating-a-custom-opt-out-form

1 Like

Thanks @Lukas .

It is our requirement to have matomo separate .

So we will test on upgraded version and will see to work that way .

1 Like