Magento for B2B Commerce

Google Content Experiments

The following example shows how to set up an A/B test of products, categories, or content pages using Google Analytics Content Experiments. We recommend that you keep two browser tabs open while working through the instructions, because you will need to bounce back and forth between the Magento AdminThe password-protected back office of your store where orders, catalog, content, and configurations are managed. and your Google Analytics account.

Google Content Experiments has been deprecated, and will eventually be replaced by Google Optimize.

Step 1: Enable Content Experiments (Magento)

Log in to the Admin of your Magento installation.

Follow the instructions to enable Google Analytics with Content Experiments in the Magento configuration.

Step 2: Set Up the Variations (Magento)
  • Each variation must have a unique URL key.
  • Each variation must have the same store view selected.
Step 3: Set Up the Experiment (Google)

You must have the appropriate permissions to the Google account to create an experiment.

Open another browser tab, and log into your Google Analytics account. If necessary, navigate to the Account and Property.

In the sidebar on the left, choose Admin. Then, do one of the following:

Choose an Existing View Create a New Reporting View

In the header of the View column, tap Create View. Then, do the following:

Identify the experiment location as one of the following:

  • Website
  • Mobile app

Enter a descriptive Reporting View Name.

Specify the Reporting Time Zone.

When complete, tap Create View. Then, click the back arrow to return to the previous page.

New Reporting View

In the panel on the left under Reports, choose Behavior > Experiments.

Tap Create experiment. Then, do the following:

Specify the percentage of traffic to redirect.

Specify the Original Page URL and the URLs of each page variation that you want to test.

Complete the other options. If you need help see: .Configure & Modify Experiments.

When the experiment is set up, tap Manually Insert the Code. Then, copy the code snippet.

Step 4: Paste Code Snippet (Magento)

Return to the Admin of your Magento installation. Then, open the original version of the product, category, or page in edit mode.

Expand the View Optimization section for the product, category, or page. Then, paste the code snippet that you copied from Google Analytics into the Experiment Code text box.

Do not paste the code snippet into any of the variations.

Product View Optimization

When complete, tap Save.

Step 5: Review and Start the Experiment (Google)

Return to your Google Analytics account.

Review the experiment settings.

If ready to begin, tap Start Experiment. Otherwise, tap Save for Later.