ABSplits

Nuxt and Vue A/B testing

Add AB Splits to your Nuxt config or your Vue app's index.html and test any route. The snippet follows client-side navigation, so tests re-apply on every route change.

Free plan · 1,000 visitors / month · no card

Set up in 3 steps

  1. 01Add the script to app.head in nuxt.config.ts, or to index.html for a plain Vue app.
  2. 02Mark tested elements with a data attribute, like data-ab="hero-title".
  3. 03Create a test with selector [data-ab=hero-title] and a URL pattern for the route.

nuxt.config.ts

export default defineNuxtConfig({
  app: {
    head: {
      script: [{ src: "https://absplits.com/s.js", "data-key": "YOUR_SITE_KEY" }],
    },
  },
});

Your real site key is shown in the dashboard after you add your site.

What to test on Nuxt & Vue

All 56 examples →

AI writes variants

Choose a headline or button and AI reads your real page to write 3–5 alternatives, each with its reasoning.

Honest stats

Chance to beat the original, 95% intervals, and a plain keep-running or stop verdict. No p-value guesswork.

Results in GA4

Every tested visitor is tagged in GA4, so any report can be split by variant.

Questions

Will Vue's hydration overwrite the variant?+

Use a stable data attribute as the selector. The snippet keeps applying changes while the page renders, so the variant holds after hydration.

Can I branch logic on the variant in code?+

Yes. Call ABSplits.variant(testId) to get the visitor's variant, and ABSplits.track("event") to record a custom conversion.

Can I see results in Google Analytics 4?+

Yes. Every visitor in a test sends an absplits_exposure event to GA4 with the test and variant name, so you can break down any GA4 report by variant. AB Splits also shows its own Bayesian results.

A/B testing on other platforms