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 need to bounce back and forth between the Commerce Admin and your Google Analytics account.
Step 1. Enable content experiments (Commerce)
-
Log in to the Admin of your Commerce installation.
-
Follow the instructions to enable Google Analytics with Content Experiments in the Commerce configuration.
{width="600" modal="regular"}
Step 2. Set up the variations (Commerce)
Create multiple variations of the same product, category, or page.
- Each variation must have a unique URL key.
- Each variation must have the same store view selected.
You can create up to ten variations of each entity that you want to test. For products, use Save & Duplicate to save time.
Step 3. Set up the experiment (Google)
-
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 and use one of the following methods:
Method 1: Choose an Existing View
In the header of the View column, click the down arrow, and choose the view that is to provide the data for the experiment.
Method 2: Create a New Reporting View
-
In the header of the View column, click Create View and do the following:
-
Identify the experiment location as either
Website
orMobile app
. -
Enter a descriptive Reporting View Name.
-
Specify the Reporting Time Zone.
-
-
When complete, click Create View and then click the back arrow to return to the previous page.
-
-
In the left panel under Reports, choose Behavior > Experiments.
-
Click Create experiment and 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.
-
-
When the experiment is set up, click Manually Insert the Code and copy the code snippet.
Step 4. Paste code snippet (Commerce)
-
Return to the Admin of your Commerce installation and open the original version of the product, category, or page in edit mode.
-
Expand the View Optimization section for the product, category, or page.
-
Paste the code snippet that you copied from Google Analytics into the Experiment Code text box.
note note NOTE Do not paste the code snippet into any of the variations. {width="600" modal="regular"}
-
When complete, click Save.
Step 5: Review and start the experiment (Google)
-
Return to your Google Analytics account.
-
Review the experiment settings.
-
If ready to begin, click Start Experiment.
Otherwise, click Save for Later.