Bubble Docs
  • Introduction
  • New? Start Here
  • What is Bubble?
  • The Glossary
  • User manual
    • Getting started
      • What is Bubble?
      • Building your first app
        • Planning features
        • Database structure
        • Design and UX
        • eCommerce and payments
          • Shopping cart
          • Checkout page
          • One-time payments
          • Subscriptions
          • Marketplace
      • Creating and managing apps
      • The Bubble editor
        • Tabs and sections
          • Design tab
            • The element tree
            • The property editor
          • Workflow tab
          • Data tab
          • Styles tab
          • Plugins tab
          • Settings tab
            • Application settings
              • Custom headers/body
              • Visual settings
              • Social media sharing
              • Translating your app
              • Email settings
              • Collaboration
            • Custom domain and DNS
          • Logs tab
        • Tools
          • Key features
          • The search tool
          • The Issue Checker
          • The element tree
          • The element property editor
          • The debugger
          • Notes
        • Previewing your app
      • Transitioning to Bubble from...
        • JavaScript
        • HTML and CSS
        • SQL
    • Design
      • Elements
        • The element hierarchy
          • The element tree
        • The page
        • Containers
          • Groups
          • Repeating groups
          • Table elements
          • Popups
          • Floating groups
          • Group focus
        • Visual elements
        • Input forms
          • Text and numbers
          • Dates and time
          • File uploads
          • Selection controls
        • Reusable Elements
      • Styling
        • Color variables
        • Font variables
        • Styles
        • Custom Fonts
      • Responsive design
        • Building responsive pages
        • Legacy articles
          • The Basics (Legacy)
          • Building Responsive Pages (Legacy)
          • Migrating Legacy Pages
          • Tips When Designing (Legacy)
      • Templates
      • The Component Library
      • Importing from Figma
    • Data
      • The database
        • Data types and fields
        • Creating, saving and deleting data
        • Finding data
        • Displaying data
        • Protecting data with privacy rules
        • The database editor
        • Export/import data
          • Exporting data
          • Importing data (CSV)
        • Working with location data
        • Using Algolia
        • Database structure by app type
          • Marketplace Apps
          • Directory & Listings Apps
          • Social Network Apps
          • SaaS Apps
          • Project Management Apps
          • CRM Apps
          • Professional Services Apps
          • On-demand Apps
          • Documentation/ CMS Apps
          • Applicant Tracking System (ATS) Apps
          • Portfolio Apps
          • Gallery Apps
          • Online Store / Ecommerce Apps
          • Blog Apps
          • Messaging App
          • Dashboards
          • Building Block Apps
          • Bubble as a backend
      • Files
      • Images
      • Static data
        • App texts (translations)
        • Option sets
      • Temporary data
        • Custom states
        • URL parameters
      • User accounts
        • Authentication plugins
          • Facebook plugin
          • Fitbit plugin
          • Google plugin
          • Instagram plugin
          • LinkedIn plugin
          • Pinterest plugin
          • Slack plugin
          • Wistia plugin
          • YouTube plugin
        • Cookies set by Bubble
      • Time, dates and time zones
    • Logic
      • The frontend and backend
      • Workflows
        • Events
          • Frontend events
            • Recurring workflows
            • Custom events
          • Backend events
            • Database trigger events
        • Actions
        • API Workflows
      • Dynamic expressions
      • Conditions
      • Navigation
        • Single-page applications (SPA)
        • Multi-page applications
        • Page slugs
    • Workload
      • Understanding workload
        • Activity types
        • The workload calculation
        • Client-side and server-side processing
      • Tracking workload
        • Measuring
          • Using App Metrics
        • Monitoring
          • Workload notifications
          • Infinite recursion protection
      • Optimizing workload
        • Optimization framework
        • Optimization checklist
          • Page load
          • Searches
          • Workflows and actions
          • Backend workflows
        • Agency showcases
          • Minimum Studio
          • Neam
          • Support Dept
    • Security
      • Bubble's security features
      • Planning app security
      • Client-side and server-side
      • Bubble account security
      • App security
      • Page security
      • Database security
      • API security
        • API Connector security
        • Data API security
        • Workflow API security
      • Flusk
        • Overview
        • Flusk plan features
        • Getting started with Flusk
        • Flusk security tools
          • The Issues Explorer
          • Issue details
          • Tools and settings
            • Pages rating
            • Database rating
        • Flusk FAQ
      • Cookies
      • Security checklist
    • Publishing your app
      • Web app
      • Native mobile app
        • Global native mobile settings
        • iOS App Store
        • Google Play Store
        • Publishing FAQ
    • AI
      • Generate apps with AI
        • About AI app generation
      • AI page designer
      • Connect to AI agents
    • Maintenance
      • Collaborators
      • Version control
        • Best practices: Version control
        • Transitioning from the legacy version control
        • Terminology: Version control
        • Version Control (legacy)
      • Commenting
      • Database maintenance
        • Copying the database
        • Restoring database backups
        • Bulk operations
          • Bulk operation methods compared
        • Wiping change history
      • Performance
        • Hard limits
        • Capacity Usage (legacy)
        • Notes on queries
      • SEO
        • Introduction to SEO
        • SEO: App
        • SEO: Page
      • Testing and debugging
        • Introduction to testing and debugging
        • The debugger
        • The server logs
        • Supported browsers
      • API workflow scheduler
    • Integrations
      • API
        • Introduction to APIs
          • What is a RESTful API?
        • The Bubble API
          • Bubble API terminology
          • Authentication
            • How to authenticate
            • No authentication
            • As a User
            • As an admin
          • The Data API
            • Data API Privacy Rules
            • Data API endpoints
            • Data API requests
          • The Workflow API
            • Workflow API privacy rules
            • Workflow API endpoints
            • API workflows
              • Creating API workflows
              • Scheduling API workflows
              • Recursive API workflows
              • API Workflow Scheduler
              • Case: Stripe notifications
        • The API Connector
          • Authentication
          • API Connector security
          • API guides
            • OpenAI
              • Authentication
              • Calls
                • ChatGPT
                  • Chat
            • Google Translate
              • How to setup Google API keys
          • Streaming API
        • API security
        • Plugins that connect to APIs
        • API Glossary
      • Plugins
        • What Plugins Can Do
        • Installing and using Plugins
        • Authentication plugins
        • Special Plugins
      • SQL Database Connector
      • Bubble App Connector
      • WorkOS
        • WorkOS SSO
        • WorkOS API
    • Infrastructure
      • Sub-apps
      • Bubble release tiers
      • Hosting and scaling
        • How Bubble hosting works
        • Scaling with Bubble
        • CDN (Cloudflare)
        • Bubble app names
        • Domain and DNS
      • Compliance
        • GDPR
        • SOC 2 Type II
        • HIPAA
        • Other frameworks and standards
    • Bubble for Enterprise
      • Hosting and infrastructure
        • Dedicated instance
          • The Dedicated editor experience
          • Technical specs
          • Main cluster dependencies
          • Customizable options
          • Migration process
            • Pre-migration
            • During migration
            • Post-migration
      • Security and compliance
        • Single sign-on (SSO)
        • GDPR
        • SOC 2 Type II
        • HIPAA
        • Other frameworks
        • Bubble's security features
      • Admin and collaboration
      • Priority support
      • Billing and Payment Guideline for Dedicated Instances
  • Core Reference
    • Using the core reference
    • Bubble's Interface
      • Design tab
      • Design tab (Legacy)
      • Workflow tab
      • Data tab
      • Styles tab
      • Styles tab (Legacy)
      • Plugins tab
      • Settings tab
      • Logs tab
      • Template tab
      • Toolbar
      • Top and context menu options
      • Deployment and version control
        • Deployment & Version Control Dropdown (legacy)
      • Notes
    • Elements
      • General properties
      • General properties (Legacy)
      • Styling properties
      • Styling Properties (Legacy)
      • Responsive Properties
      • Responsive Properties (Legacy)
      • Conditional formatting
      • States
      • Page Element
        • Page Element (Legacy)
      • Visual Elements
      • Containers
      • Container Layout Types
      • Containers (Legacy)
      • Input Forms
      • Reusable Elements
      • Element Templates (legacy)
    • Workflows
    • Events
      • General events
      • Element events
      • Custom events
      • Recurring event
      • Database trigger event
    • Actions
      • Account
      • Navigation
      • Data (things)
      • Email
      • Element
      • Custom
    • Data
      • Data Sources
      • Operators and comparisons
      • Search
      • Privacy
    • Styles
    • API
      • The Bubble API
        • The Data API
          • Authentication
          • Data API endpoints
          • Data API requests
        • The Workflow API
      • The API Connector
        • Authentication
        • Adding calls
    • Bubble-made Plugins
      • AddtoAny Share Buttons
      • Airtable
      • API Connector
      • Blockspring
      • Box
      • Braintree
      • Bubble App Connector
      • Chart.js
      • Circle Music Player
      • Draggable Elements
      • Dropzone
      • Facebook
      • Fitbit
      • Full Calendar
      • Google
      • Google Analytics
      • Google Optimize
      • Google Places
      • Ionic Elements
      • iTunes
      • Slidebar Menu
      • LinkedIn
      • Localize Translation
      • Mixpanel
      • Mouse & Keyboard Interactions
      • Multiselect Dropdown
      • Progress Bar
      • Rich Text Editor
      • Rich Text Editor (Legacy)
      • Screenshotlayer
      • SelectPDF
      • Slack
      • Segment
      • Slick Slideshow
      • SQL Database Connector
      • Star Rating
      • Stripe
      • Tinder-like Element
      • Twitter
      • YouTube
      • Zapier
    • Application Settings
      • App plan
      • General
      • Domain / email
      • Languages
      • SEO / metatags
      • API
      • Collaboration
      • Sub-apps
      • Versions
  • Account & Marketplace
    • Account and billing
      • Pricing and plans
        • Plans and billing
        • Billing cycle
        • FAQ: Pricing and Workload
      • Account Management
      • Building Apps for Others
      • Selling on the Marketplace
      • Plans & Billing (legacy)
    • Official Bubble Certification
      • Hiring certified developers
    • Building Plugins
      • The Plugin Editor
      • General Settings
      • Updating to Plugin API v4
      • Adding API Connections
      • Building Elements
      • Building Actions
      • Loading Data
      • Publishing and versioning
      • Github Integration
    • Building Templates
    • Application and data ownership
    • Marketplace policies
    • Bug reports
  • Vulnerability Disclosure Policy
  • Beta features
    • About the Beta features section
    • Native mobile apps 🔒
      • Introduction
        • What is a native mobile app?
        • Native mobile vs. web development
        • Differences in native and web elements
        • Native mobile app terminology
      • Building
        • Views and navigation
        • Native mobile actions
        • Components and gestures
        • Device resources
          • Location services
          • Camera/photo library
      • Previewing
      • Publishing
Powered by GitBook
On this page
  • Get Google Optimize Experiment Group
  • Set Google Optimize Experiment On This Page
  • Setup
  • What you'll need
  • If you're using Segment
  • Setting up the Google Optimize plugin
  • Setting up an experiment in Google Optimize
  • A few important notes
  • Designing an experiment in the Bubble editor
  • Important step: telling Optimize to pay attention to a user
  • To create different variant behavior
  • FAQ

Was this helpful?

  1. Core Reference
  2. Bubble-made Plugins

Google Optimize

Note: As of December 2020, we're investigating issues when using the Google Optimize plugin in conjunction with Bubble's Google Analytics plugin, we think due to changes Google made in their recent major update of GA.

Bubble has built a plugin with Google Optimize to enable you, as the app creator, to run A/B tests (randomized split tests) on your Bubble app.

An A/B test is great when you have a clear action you want your users to achieve, and you're deciding between two slightly different experiences in your app to try to get your users to accomplish that action. For example:

  • You have two different possible versions of a landing page, and you want to see which one leads to higher rates of users signing up

  • You have three different sets of copy for your home page, and you want to see which one leads to more users clicking a certain button

  • You want to see if showing a popup after a user logs in will increase the likelihood of that user purchasing something

There are many online resources explaining the principles of A/B testing and what makes for a good vs. bad test - it's a very helpful tool for data-driven decision making!

Note: there are other third party A/B testing tools out there. These generally will not work smoothly with Bubble apps because of how Bubble renders your app's pages - essentially, our Javascript will interfere with the testing tool's Javascript. That's why we created this plugin, which allows you to design A/B tests within the Bubble editor, and to have them run on your app without any problems!

Get Google Optimize Experiment Group

This data source is a number that indicates which control or variant group the current user is in. "When Get Google Optimize Experiment Group is 0" means the user is in the control, usually the original experience you had. "When Get Google Optimize Experiment Group is 1" means the first variant you have, "...is 2" means the second variant (if there is a second variant), etc.

Set Google Optimize Experiment On This Page

This action is necessary to "mark" a user as part of an experiment and thus as somebody who should be counted as part of the experiment's analytics. Even if this action is not used, the user will still be assigned to an experimental group and thus may see the variant - they just will not be counted in the analysis in Google Analytics.

Setup

What you'll need

  • Sign up for a Google Analytics account

  • Sign up for a Google Optimize account - Optimize is part of the same suite of products as Google Analytics, and has a generous free tier

  • Have your app connected to either (1) Google Analytics, OR (2) Segment with Google Analytics as a destination - these tools help you capture data about user activity, which is what's needed to measure the impact of your test; Bubble offers free Bubble-made plugins for GA and Segment

If you're using Segment

To use Segment with Google Optimize, in your Segment settings for Google Analytics, set Connection Mode to Device Mode (this is important! Currently we do not support Cloud Mode with Google Optimize.)

Setting up the Google Optimize plugin

1.Install the Google Optimize Plugin in the Bubble editor via the Plugins tab, as with any other plugin. Once installed, you should see this settings page for the plugin:

Optimize plugin settings

After creating an experiment in Optimize, you will copy the Experiment ID and the number of variants into the appropriate fields here as well. (See below)

(Note: pre-April container IDs will start with "GTM", post-April will start with "OPT")

Setting up an experiment in Google Optimize

When you first set up Google Optimize, you will be linking it up to your Google Analytics account.

A few important notes

  • Set the editor page to "SERVER-SIDE" (or whatever else, it doesn't really matter but it should not match an actual url on your app)

    • You might see a warning that this doesn't match URL targeting rules, but this is safe to ignore

  • Note the number of variants, and note that the original (the "control" in the experiment) counts as a variant. I.e. if you have the control and one other design to test, that would be 2 variants. This number goes into the Plugins tab in the settings for Google Optimize

  • You can rename the variants in Google Optimize however you wish; the Bubble editor does not refer to them

  • Audience targeting no longer has any affect from the optimize UI

Before you start the experiment, you have to set the Objective(s), which are the quantitative goals the experiment will look at to measure the success of the variants. You can either:

  1. Choose from list: this will only give you access to Google’s default objectives (bounces, pageviews, session duration)

  2. Create custom: this will give you access to events you’ve identified and sent to GA, possibly through Segment (this gives you much more control over the different behaviors you wish to measure / influence)

    1. If you've already sent Segment / GA custom events in the past, you should be able to find the option to have Event Action equal 'your_event_name'

When these components are all ready, make sure to start the experiment!

Designing an experiment in the Bubble editor

Your experiment will likely be measuring some kind of custom event you send to Segment. As a brief introduction, if you have the Segment plugin set up, you'll be able to use the "Track an event with Segment" workflow action in the Bubble Editor.

For example, if you want a click on a button called "Conversion Event!" on page A to log an event called "user_did_a_thing", you'd set it up like this:

Logging a custom event with Segment via a workflow

If you check in the Segment interface, you should see this event in the "Debugger" pretty immediately.

If you check in the Google Optimize objectives page, you should see this event name pop up in the dropdown list of known custom events.

Important step: telling Optimize to pay attention to a user

The Optimize plugin does not automatically assume that every user who visits your app is part of the experiment. Rather, you must tell Optimize when a user should be considered as participating in an experiment!

(Why this way: imagine you have an experiment running only on the logged-in dashboard of your Bubble app. In this case, you might have lots of users visiting your landing page, but most of these users won't be logged in. Thus, to get accurate numbers, you only want to run the experiment on users who visit the page and are logged in.)

To tell Optimize that a user should be considered for an experiment, you must run the workflow action "Set Google Optimize experiment on this page" when relevant. In many cases, you'll probably run this action "When page is loaded", although you could create more complex logic.

You can find the action within the "Analytics" category.

You can think of this action as initiating all the rest of the Google Optimize logic. If this action is on a page, then a user visiting that page will be randomly assigned into a variant; these assignments are sticky, meaning if the user leaves and later comes back to that page, they will be in the same variant as before.

To create different variant behavior

To design the different experiences you want to test, you'll be relying on conditional statements that effectively say something like "if the user is in experimental group 1, show this element".

To create behaviors that differ based on variants, use the datasource "Get data from an external API" and select "Get Google Optimize Experiment Group", and use that as a condition in workflows, element conditions, etc.

  • "When Get Google Optimize Experiment Group is 0" means the control, usually the original experience you had

  • "When Get Google Optimize Experiment Group is 1" means the first variant you have

  • (etc. for experiments with more variants)

For example, on an element's condition tab, you might have a button where the control is that it's rotated 45 degrees, but in the first variant, you want the background color to be yellow:

Using the group assignment in conditions

You will usually be defining both the control and variant behavior. Make sure you preview your app to see if the variants are what you want! (Hint: to more fully preview a variant, you can add more clauses to the conditions to temporarily force the entire statement to be true or false, e.g. "When group is 0 or Current User is Current User" will always be true, and "When group is 0 or Current User is not Current User" will always be false).

After you've started your experiment in Google Optimize and you roll out your changes, the experiment is running! The Google Optimize / GA interface is not quite real-time, but if you have users going through your experiment, you should start seeing an indication of this in the Google Optimize interface.

FAQ

  • Because Google Optimize records data about the experiment in Google Analytics, results are not available in real time, i.e. they are usually several hours delayed

  • If no data is showing up in Google Analytics pertaining to an experiment, make sure you're using the "Set Google Optimize Experiment On This Page" action

Last updated 4 years ago

Was this helpful?

Have a Bubble app that's on the current Professional tier or above (see our page)

On the same page, further down, you need to provide your Optimize :

https://gblobscdn.gitbook.com/assets%2F-M5sbzwG7CljeZdkntrL%2F-MEYgEWkEfthhj4p-G5b%2F-MEYhE2QUrZ9VwfYPWU7%2Fgopt_3.jpg?alt=media&token=8dc4fbd7-900d-49e7-9193-e458933d934c

You can find your Optimize Container ID on your homescreen at . (Note: pre-April container IDs will start with "GTM", post-April will start with "OPT")

You will need to provide your Optimize , found on

These steps are done in

Follow the Optimize flow to create a "server side" experiment. The general steps are , but a summary is:

Pricing
Container ID
optimize.google.com
container ID
optimize.google.com
Google Optimize
here
Create an experiment in Optimize
Set experiment objectives
Set experiment targeting
Create variants
Start the experiment
Get the experiment ID
https://gblobscdn.gitbook.com/assets%2F-M5sbzwG7CljeZdkntrL%2F-MEYgEWkEfthhj4p-G5b%2F-MEYgwwns7rp9aKwkoLa%2Fgopt_1.jpg?alt=media&token=628025a9-9f99-4e97-84c8-715e6dc003d2