Google Optimize setup for website A/B testing

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Google Optimize setup for website A/B testing
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Setting Up Google Optimize for A/B Testing

Important: Google Optimize discontinued on September 30, 2023. Existing integrations stopped working. If your site used Optimize — migration to an alternative tool is required.

Google Optimize Replacements

Tool Type Features
VWO Paid Closest functional replacement
Optimizely Paid Enterprise-level
AB Tasty Paid Good GA4 integration
Statsig Paid/Free Feature flags + experiments
GrowthBook Open-source Self-hosted, free
Eppo Paid Data Warehouse native

GrowthBook: Open-Source Alternative

# Docker installation
docker-compose up -d  # from official docker-compose.yml
# Dashboard: http://localhost:3000
// SDK integration
import { GrowthBook } from '@growthbook/growthbook'

const gb = new GrowthBook({
  apiHost: 'https://cdn.growthbook.io',
  clientKey: 'sdk-abc123',
  enableDevMode: true,
  trackingCallback: (experiment, result) => {
    gtag('event', 'experiment_viewed', {
      experiment_id: experiment.key,
      variant_id: result.variationId,
    })
  }
})

await gb.loadFeatures()

// Use in component
const ctaText = gb.getFeatureValue('cta_text', 'Buy now')
const showBanner = gb.isOn('promo_banner')

What Was in Google Optimize and How to Replace

A/B test via visual editor: Optimize allowed creating tests with clicks, no code. GrowthBook requires minimal code, VWO provides a visual editor.

Audience targeting: Optimize integrated with GA4 audiences. VWO and AB Tasty have their own segments + GA4 integration.

Personalization: Optimize 360 (paid) supported personalization. Replacements: AB Tasty, Dynamic Yield, Monetate.

Migrating Existing Tests

// Was (Google Optimize)
gtag('event', 'optimize.callback', {
  name: 'ABCxxx',
  callback: (value, name) => {
    console.log('Experiment:', name, 'Variant:', value)
  }
})

// Now (GrowthBook)
const variant = gb.getFeatureValue('experiment_name', 'control')
// Then apply variant manually

Custom A/B Without Paid Tools

For simple tests without visual editor — self-hosted GA4 solution:

// feature-flags.js
const EXPERIMENTS = {
  'hero_headline': {
    variants: ['control', 'variant_a'],
    weights: [0.5, 0.5]
  }
}

function assignVariant(experimentId) {
  const stored = sessionStorage.getItem(`exp_${experimentId}`)
  if (stored) return stored

  const exp = EXPERIMENTS[experimentId]
  const random = Math.random()
  let cumulative = 0
  let chosen = exp.variants[0]

  for (let i = 0; i < exp.variants.length; i++) {
    cumulative += exp.weights[i]
    if (random < cumulative) {
      chosen = exp.variants[i]
      break
    }
  }

  sessionStorage.setItem(`exp_${experimentId}`, chosen)
  gtag('event', 'experiment_viewed', { experiment_id: experimentId, variant_id: chosen })
  return chosen
}

Delivery Time

Migration from Google Optimize to GrowthBook or VWO + transferring existing tests — 2–3 business days.