Content experiments for mobile apps

Content Experiments for mobile apps are DEPRECATED. The feature will be removed in 2018.

Mobile app experiments are now supported via Firebase, Google's mobile app development platform. The older Content Experiments for mobile apps are being deprecated in favor of the Firebase A/B testing feature. To use the new A/B testing functionality, ensure that you have added Firebase to your app. We also recommend that you use the latest version of the Google Tag Manager mobile SDKs (Android | iOS) with an associated iOS or Android Firebase container.

Please see the following deprecation timeline and plan accordingly.

Dec 2017:

  • Existing experiments will continue running until they expire or are removed from the container.
  • New experiment variables cannot be created.
  • New container version cannot be created from a workspace if it contains a newly added experiment variable
  • A version cannot be published if it contains a newly added experiment variable.

Mar 2018:

  • Reports for experiments will be available in Google Analytics until June 2018. Please use the export feature provided by Analytics if you wish to retain the data beyond that period.
  • New container versions cannot be created from a workspace if it contains an experiment variable (new or existing).
  • A container version cannot be published if it contains an experiment variable (new or existing).

Fixing references to experiment values:

If you reference values from your experiment variable in other tags or variables in your container, you will want to make sure that the references remain valid. In that case, instead of deleting an experiment variable, change the type from "Google Analytics Content Experiment" to "Value Collection" and assign the original variation of the experiment to it:

  1. In Tag Manager, open your Google Analytics Content Experiment variable configuration.
  2. In Variations, copy the value of the original variation. (e.g. {'key1':'value1'})
  3. In Variable type click the pencil icon to change it and select Value Collection.
  4. In the Value Collection text area, paste in the value you copied from the original variation of your old experiment variable.
  5. Select a trigger, save your variable, and publish your container.

Google Analytics Content Experiments allows you to test multiple variations of a given web page to find out which one results in the greatest improvement in your website metrics. Experimenting with content in mobile apps is now also possible with Google Analytics Content Experiments in Google Tag Manager.

Before you get started...

If you are new to content experiments, please read Overview of Content Experiments for Google Analytics.

If you are new to Google Tag Manager, please read Setup and Workflow (Mobile Apps) first. Here’s a quick overview of the steps to create a mobile tag container:

Set up a new mobile container

Set up one container per mobile app. Each new major version of your app should have its own container. Name the container after the app and version, for example "exampleapp2_1".

  1. In Google Tag Manager, select an account. The Containers page appears.
  2. On the Containers page, click Admin in the top nav bar.
  3. From the Containers dropdown menu, choose Create Container…
  4. Enter a container name when prompted. Select if you will use the container for Android or for iOS and click Create.

Note: To make use of Content Experiments, use the Android 3.02/iOS 3.06 or later versions of the Google Analytics Services SDK. Experiments will only be run in apps using these versions of the SDK or later. Apps using a lower version of the SDK will run using the original variation but will not contribute to experiment results.

Linking to your Google Analytics view

The next step is to establish a link between your Google Tag Manager container and the Google Analytics property that will be used to handle your content experiments. You will need to have edit access to the Google Analytics Property as well as the Google Tag Manager Container to proceed. This is a critical step, but the good news is you only have to do this once per tag container. To set up this link:

  1. In the left navigation panel, click on External Account Links → Overview.
  2. Click on the Link to Google Analytics button, which is found on the right side of the title area.
  3. In the Google Analytics Property menu, select the property you wish to use.
  4. In the Google Analytics Views menu, select one or more views.
  5. Click the confirmation popup to acknowledge that you understand that information will be shared between Google Tag Manager and Google Analytics.

Set up a Value Collection Variable

A Value Collection Variable is used to set JSON-formatted configuration values for your application.

  1. From the Workspace Overview page, click on Variables in the left navigation and click the New button.
  2. Under Choose your variable, select Value Collection.
  3. Select the conditions when the variable should be enabled.
  4. Enter a name in the Variable Name field.
  5. Enter some standard data for your default Value Collection as a JSON object. For instance, you could set a value for your registration form’s button text:
    { 'buttonText': 'Register' }
    Your application will need to be developed in a way that allows this data to be leveraged. Consult with your development team on this if you need help.
  6. Select at least one enabling rule and any disabling rules that you might need.
  7. Click Create Variable.

Setting up an objective in Google Analytics

You will need an objective identified to run your content experiments against. An experiment objective can be selected from the predefined set of metrics, such as Appviews, or it can be a specific goal that you have defined yourself in Google Analytics. Read the Set up and edit Goals article for Google Analytics for a complete description of how to set up a custom goal for your content experiment. For instance, you may want to set up a goal for registration form submissions, or for completing product orders.

Setting up the Content Experiment

Content Experiments leverage Value Collections to handle the parameters of your tests, and Goals (set in Google Analytics) to provide a target for your test evaluations.

  1. From the Workspace Overview page, click on Variables in the left navigation and click the New button.
  2. Select the variable type called Google Analytics Content Experiment.
  3. Choose when the variable will be enabled (Always or Custom) and select custom triggers, if applicable.
  4. Enter a name for your variable.
  5. Click Link to Google Analytics Views and set up your external account link. You need edit access to a mobile Google Analytics property with at least one mobile view to create or update an external account link. Follow these instructions to add a mobile view to your Google Analytics property. Account and property values are prefilled for you based on your link to your Google Analytics account.
  6. Select the view that you would like to use from the View menu.
  7. Select an Experiment Objective from the Experiment Objective menu. You may use one of the predefined metrics, or select a custom one defined in your Google Analytics view.
  8. Set your Value Collection Variations. You may enter up to ten variations. Note that if you select a key-value pairs to use in your experiment value collections from existing value collections, then you should remove those key-value pairs from the existing value collections.
  9. In the Advanced Experiment Options sub menu, you can optionally set several options including:
    • Set a percentage of users who will be exposed to an experiment variation.
    • Set the minimum confidence threshold required before Google Analytics can declare a winner.
    • Set the minimum experiment runtime before a winning version is declared.
    • Set which variation (best performing or original) all users will be exposed to when the experiment ends.
    • Enable equal variation weighting.
  10. Set an enabling rule and any disabling rules that apply.
  11. Click Save.


  1. In the main container view, click Publish.
  2. Review the publish confirmation dialog to make sure it has the changes you are expecting.
  3. Click Publish Now, and your experiment will be underway!

An experiment variable starts when it is first published in a container version. An experiment stops when a version of the container is published that no longer includes the variable. It will take at least one day before experiment data begins to show up in Google Analytics. The experiment will end once a winning version has been found, if the experiment has run for the maximum length of 90 days, or if the progress of the experiment indicates that it will be unlikely that a clear winner will ever be found.

Now you can monitor your experiments in Google Analytics by clicking the link in Google Analytics Content Experiment variable in the version overview screen to see how the different variations have been performing.

Was this article helpful?
How can we improve it?