Does Google Optimize work inside an iframe hosted on an external domain?

107 Views Asked by At

I'm running and A/B test with Google Optimize on one of my pages. This page is shown on multiple website on different domains through an iframe.

So, domain of my page is different from domain of the website hosting the iframe. I have no control on the website hosting the iframe.

The problem is that I'm not seeing any data collected from the Experiment in Google Optimize. I suspect that iframe an Google Optimize don't work smoothly together.

I can't find a clear answer on the documentation or in another questions online.

Do you know if is it possible to run an AB test inside on iframe hosted on a different domain? If Google Optimize is the problem, do you know other tools that work properly in this situation?

2

There are 2 best solutions below

0
SilviaGDLR On

I think is a problem with the _gaexp cookie, "SameSite" and "Secure" settings, because your iframe is in different domain

In these threads you can see similar problems with iframes:

Possibility to set cookie flags to _gaexp

https://support.google.com/optimize/thread/75547539?hl=en

0
Ashrin Tamim On

The test is supposed to run only on your domain and the user who landed on your domain will be part of the test and included in reports data. The variation will not be shown on other domain webpages in which your website is loading through iframe. And also visitors landing on those domains and seeing your website through the iframe will not be part of the test.