Using the Yireo Google Optimizer plugin

The following guide helps you to install and configure the Google Optimizer plugin in Joomla!. Make sure you also read the Google documentation on Google Optimizer, because this plugin assumes you have already experience with that.

Installing and enabling the plugin

Install the plugin package through the Joomla! Installer.

Before you can use the plugin you need to activate the plugin. Within the Joomla! Administrator browse to Plugin Manager and enable the plugin "System - Google Optimizer".

Plugin settings

Within the System - Google Optimizer settings you can change the following:

  • Google Account ID: Here you can enter your Google Account ID (starting with "UA-") globally. This setting can be overridden by the plugin-tags (see below).
  • Google Experiment ID: Here you can enter the tracking ID of the Google Experiment you have created. This setting can be overridden by the plugin-tags (see below).
  • Remove tags: While the plugin itself can be enabled or disabled through the Plugin Manager, this setting determines whether the Google Optimizer scripts are inserted or not. If you enable the plugin through the Plugin Manager and this setting to "Yes", all plugin-tags will be filtered from your content. The plugin-tags are not removed from your content however - that's something you will need to do yourself.

Setting the Google Account ID globally is probably a very wise thing to do. Most people use one Google Account for managing one website. But for one website you might configure many Google Experiments. So setting the Google Experiment ID globally is perhaps less useful.

Defining the pages

Google Website Optimizer requires you to add JavaScript to your webpages. This plugin makes entering the right JavaScript-code in your Joomla! content a lot easier by using simple tags.

For the Google Website Optimizer to optimize anything at all you will need to define three kinds of pages:

  • Original page: Visitors perhaps arrive on this landing page, and you want to know how many people go from here to the specified destination.
  • Variation page: If the same content from the original page is also available anywhere else, it might be useful to track these other pages as well. Note that you will need to define sections to make this useful (see below).
  • Conversion page: This is the destination where you expect visitors to go. This could be another article or perhaps a VirtueMart checkout page.

In the following chapters you will learn how to add plugin-tags to your content to define these pages.

Step 1 - Insert a control-script

This Joomla! plugin uses a very short syntax to define where JavaScript-code should be inserted. You could define as original page a certain Joomla! article, so you wil need to insert a control-script plus a tracking-script in this article.

Example 1

Just open up the article and add the following somewhere on the page:

{go type=control}

Here go stands for google optimizer while type=controldefines that the control-script should be inserted.

Example 2

A more complex example redefines the Google Account ID (account) as well as the Google Experiment ID (tracker).

{go type=control account=UA-0000000-1 tracker=00000000}

NOTE: Because a control-script is always accompanied by a tracker-script, a tracker-script is automatically appended.

Step 2 - Insert a conversion-script

Next to a control-page you will definitely also need a conversion-page. Open up the content for your conversion-page and add the following:

{go type=conversion}

Again, the tag allows us to define the account and the experiment tracker, but you can leave them out if the global plugin-settings have been properly configured.

Step 3 - Insert a tracking-script

The same that applied to the types control and conversion also applies to tracking.

{go type=tracking}

Step 4 - Check pages with Google

Now the pages have been defined, you probably want to re-check the pages within the Google Website Optimizer to make sure the JavaScript is loaded properly. Within the Google Website Optimizer panel, browse to your experiment and click on Re-check pages.

Step 5 - Using sections

When defining multiple pages using tracking-scripts you will need to make clear which content is the same over multiple pages. The section-tag allows you to define identical content identified by a certain ID:

{go section="ID"}CONTENT{/go}

This tag is different from the other tags, because it requires not only a section parameter, but also an ending tag ({/go}.

{go section="Example 1"}
This is some content
spread out over multiple lines
which need to tracked
by Google Website Optimizer

NOTE: Make sure both the section-ID (in this case "Example 1") and the content (in this case "My Google content") are exactly the same in all places.

About the syntax

Here are some legal examples of the plugin-code:

{go type=control}
{go type="control"}
{go type='control'}
{go type="control" tracker="0123456789"}
{go type="tracking" tracker="0123456789"}
{go type="conversion" tracker="0123456789"}
{go section="Example 1"}My Content{/go}

And here are some wrong you should not use:

{go type=control
{go section=Section without quotes}My section{/go}
{go section=Section without end tag}My section

Using the plugin for VirtueMart

The content of products is normally not handled by plugins. For this plugin to work with product descriptions as will, you will need to activate the setting "Enable content mambots / plugins in descriptions?" within the VirtueMart configuration (Global > Frontend Features).

Alternatively you can add the plugin code to the VirtueMart theme-file "checkout.thankyou.tpl.php" instead.

Using the plugin in other extensions

If the content of other extensions is handled by plugins, adding the plugin-tags to the content is sufficient. If this is not the case, adding the plugin-tags to the proper webpage could involve theme changes, output overrides or even core-hacks.