Cloudflare APO and A/B Testing on Google Optimize

I use The cloudflare pro plan and have APO turned on.
I recently started A/B testing again using google optimize. I found that it wasnt working correctly until I bypassed the cache with a page rule for the URL I was testing on.

Is this the correct way to do it? My only problem with that is the URL in question is now a lot slower while the test runs!

Any guidance or tips are appreciated.

How so? If I recall, something is different at Cloudflare when running Google Tests when compared to a regular visitor. Like certain settings don’t apply when Googlebot comes calling. I could be mistaken.

Definitely a good use-case for Workers here, control some of the caching. As well, I’ve found Google Optimize out of the box, client-side to be pretty non-performant.

Did you set it up through Tag Manager? Or?

Visitors were not getting sent to the alternative URL with the changes on it being tested.

Workers? Excuse my ignorance but what would they do here?

Ive set up google optimize using the code it gives me to insert into the header on the pages being tested. Its looking for goals being met to work out the best conversion rate. These goals are tracked using GTM - but I havent integrated optimize with gtm directly. Is there an alternative way?

Ah…is this coordinated with a plugin that would trigger A or B for your visitors? If so, then APO is caching the same page for everybody, and your Page Rule to bypass cache for that page is the correct approach.

The google optimize snippet sends the visitor to either page A or page B - so I guess I just have to live with the speed drop during the test. Thanks for the help!

1 Like

Sounds like you’re setup to A/B test with Optimize differently than I’d assumed. I prefer the HTML edit same page approach vs sending to A and B URLs. Can then markup each variants’ buttons, CTA, etc. with unique ID’s to know which is which for Event and Goal tracking in GA.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.