Google Content Experiments replaces Google Website Optimizer as the tool which website owners can use for the split testing of their site’s pages.
Content Experiments is a tool which can be found in your Google Analytics account from which you can do your split testing with.
The WP Content Experiments & Event Tracking plugin gives you the ability to carry out Google split testing on your WordPress site by providing an easy interface which you can use to paste the relevant google experiments control code into the header of the page/post of your choice.
In addition, if you want to perform event tracking on buttons, links or other elements so you can analyse the data in your google analytics account, this plugin allows you to easily add the event tracking code to particular elements from your wordpress post/page editor window.
In order to run content experiments or event tracking, you will need a Google Analytics account and have your tracking code inserted into your blog.
To learn more about how to use Google Analytics, there is a great blog post from my friends at firstsiteguide.com who explain how to use Google Analytics for WordPress.
Therefore this plugin requires that you have the Google Analytics For WordPress plugin installed and configured.
Download the WP Content Experiments & Event Tracking Plugin:
Tested up to: 3.4.1
Installing the WP Content Experiments & Event Tracking Plugin
- FTP the wp-content-experiments
/wp-content/plugins/directory, OR, alternatively, upload the wp-content-experiments.zip file from the
Plugins->Add Newpage in the WordPress administration panel.
- Activate the wp-content-experiments plugin through the ‘Plugins’ menu in the WordPress administration panel.
Using the WP Content Experiments & Event Tracking Plugin
- You will need an active google analytics account. If you don’t have one, you can create a new one here:
- You will need to have installed and configured the Google Analytics for WordPress plugin which can be found here:
(this will ensure that your Google Analytics tracking code will be inserted inside your site’s <head> tags)
Adding Content Experiments code to a post or page
Step 1: Using the WP editor open the page or post you wish to treat as the “Original” page for the content experiment you want to perform.
Please see the google help pages for how to setup/run experiments:
Step 2: Enable the checkbox in the “Content Experiments For WP” section to activate the feature. (see 1 circled in figure below)
Step 3: Paste the Google Content Experiments code into the text box. (You will get this code from your Google Analytics account)
(see 2 circled in figure below)
Important: You should only paste the content experiments code in the page which you nominate as the “Original” in the experiments setup of your Google Analytics account, ie, do not paste the code in the “Variation” page(s)
Step 4: Save your settings by saving or updating the post or page, ie, click “Update” button.
You can check whether your code was added correctly within the page’s <head></head> tags by viewing the source of the web page.
Adding google event tracking code to an element on a post or page
Pre-requisite: To perform event tracking you will need to set up a goal in your Google Analytics account.
Please see the google help pages: http://support.google.com/analytics/bin/answer.py?hl=en&answer=1032415
Step 1: Choose the page/post which you want to perform event tracking on. For example let’s say we had the following page which consists of a form with a button:
Step 2: Get the CSS class name or ID of the element which you want to do event tracking on. For our example it is the “Send” button shown in the figure above.
The easiest way to get class name or ID is to use Firebug by right-clicking on the element in your browser and selecting “Inspect element” (see figure below)
You can then obtain the CSS class name or ID name (depending on your situation) as shown below. You will need this name for the next step.
Step 3: Using the WP editor open the page or post you wish to perform event tracking on, ie, in our case it will be the page containing the form in the figures above.
Step 4: Enable the checkbox called “Enable Event Tracking for this page” in the “Event Tracking” section to activate the feature. (see circled item 1 in figure below)
Step 5: Enter the values for the Category, Action and Label fields. (These values should have been set by you when you were configuring your goal in your Google Analytics account) (see circled items 2, 3, 4 in figure below)
Step 6: Enter either a CSS ID name and/or CSS classname of the element you wish to track. (see circled items 5 in figure below)
Step 7: Save your settings by saving or updating the post or page, ie, click “Update” button.
Tip: You can check whether your event tracking code was added correctly to the appropriate element by viewing it in firebug, ie, by rightclicking the element and selecting “Inspect Element with Firebug” when using the Firefix browser. You should see the code which this plugin added as per the example below
(click image to see larger version):