A/B test - Redirect to test URL causes a flicker and shows the default page while Variant Query Parameters cause looping and data mismatch in GA4/AEP | Community
Skip to main content
VidyR
Adobe Champion
Adobe Champion
January 30, 2026
Question

A/B test - Redirect to test URL causes a flicker and shows the default page while Variant Query Parameters cause looping and data mismatch in GA4/AEP

  • January 30, 2026
  • 0 replies
  • 9 views

We are A/B testing an experience where Cohort B is redirected to a ‘/page-b’ while cohort A should see the default ‘/page-a’.

What was happening initially- 

Initially we used AT’s redirect offers but it was conflicting with our Next.js routing/CDN . It caused flickering and messed up React's hydration process. It also prevented us from getting correct readings for our test experience in GA4

This is what we did as a bypass solution -

  1. Created the A/B test using FEC with a redirect mbox and a JSON offer.
  2. Created a middleware at the Next.js level that intercepted the request from a user’s device on our server before the page loads (before any HTML is sent)
  3. It calls Adobe Target's Edge Network to get the redirect decision asking  "Should I redirect this user?" and Target responds with either a redirect decision or no action.
  4. If a redirect is needed, the middleware sends a display notification to Target for analytics tracking, then performs the redirect, and the user lands on the destination page having never seen the original page.
  5. The _app.js code then reads URL parameters and populates ttMeta so analytics can track which experiment the user is in.

Question 1: Is there a better way to resolve our issue than what we implemented? And do you think this has anything to do with our architecture and doing this server-side?

p.s. we also have client side webSDK deployed that sends data to AEP. And we are in the process of migrating our content to AEM cloud. But we are not getting rid of our Next.js front-end for now. We are taking a hybrid approach (this info. should not impact my actual question related to AT, I hope)