Sign in

Recipe: multi-language A/B

Generate the same script in multiple languages/voices and compare performance.

typescript
const variants = [
  { language: 'en', voiceId: 'el_brian' },
  { language: 'pl', voiceId: 'el_george' },
];

const jobs = await Promise.all(
  variants.map((v, i) =>
    cf.jobs.create(
      { script: scriptFor(v.language), ...v, style: 'cinematic' },
      { idempotencyKey: 'ab-' + campaignId + '-' + i },
    ),
  ),
);

Tag each variant in your analytics, publish both, and keep the winner.