How to Add Google Optimize in WordPress (2 Easy Methods)

Google Optimize Container ID screenshot

Looking to set up Google Optimize on your WordPress site? As a webmaster with over 15 years of experience, I‘ll show you exactly how to get it running.

Whether you‘re a total beginner or WordPress pro, this guide will walk you through integrating Google Optimize step-by-step. By the end, you‘ll be ready to start split testing right away!

The Power of A/B Testing

First, let‘s discuss why A/B testing is so valuable for optimizing your WordPress site.

Through split testing, you can directly see how small changes impact your conversions and revenue. Things like your headlines, page layouts, images, and calls-to-action can be optimized over time.

According to a study by MarketingSherpa, A/B testing can lift conversion rates by as much as 40%. It also found that dedicated optimization programs delivered an average ROI of 223%.

So even just a few basic tests can significantly boost your bottom line. With Google Optimize, you can run these tests for free directly on your live site.

How Google Optimize Works

Google Optimize allows you to set up split tests without coding or design expertise. You use a simple visual editor to build variation pages.

Optimize will then show these variations randomly to your site visitors. As traffic interacts with each one, it gathers data on how they perform.

Over time, Optimize discovers which version converts best for your goals. You can implement the winning variation live to optimize that page.

Tests can be on pages, landing pages, images, copy, and more. You can even target variations to certain audiences.

The tool integrates seamlessly with Google Analytics for in-depth reporting on your experiments.

Step 1: Install Google Analytics Tracking

Since Optimize relies on Analytics, you‘ll first need to install the Google Analytics tracking code on your WordPress site.

The easiest way is using MonsterInsights, the most popular analytics plugin. It handles all the technical aspects and just takes a few minutes to set up.

Once installed, MonsterInsights will automatically begin collecting analytics data from your site. This is required for Optimize to function correctly.

Step 2: Sign Up for Google Optimize

Next, head over to the Google Optimize website and click "Get Started" to create your free account.

Select your website when prompted so it links directly with Analytics. You can skip adding the tracking snippet for now.

Step 3: Find Your Container ID

Each Optimize account has a unique Container ID that must be added to your site. This allows Optimize to load the necessary JavaScript for tests.

To find your ID, go to the Container Setup panel:

Google Optimize Container ID screenshot

Copy this ID number as you‘ll need it soon.

Method 1: Use MonsterInsights (Recommended)

The easiest way to deploy Optimize is using MonsterInsights. It handles all the technical aspects automatically.

First, install the MonsterInsights plugin and connect Analytics.

Next, go to Insights > Addons and install the Google Optimize addon. Activate it.

Then under Settings > Conversions, enter your unique Optimize Container ID.

That‘s it! MonsterInsights will now deploy the tracking code and container for you. Super simple.

Method 2: Manually Install the Snippet

You can also manually install the Optimize snippet by adding this code before the </head> tag:

<script>
  ga(‘require‘, ‘GTM-XXXXXXXX‘); 
</script>

Replace GTM-XXXXXXXX with your own Container ID.

Important: The analytics.js code must load before the Optimize snippet.

However, I recommend MonsterInsights even for advanced users, as it handles any updates automatically. The manual method is more prone to errors.

Start Creating Split Tests

You‘re all ready to start A/B testing on your WordPress site!

Here are some ideas to test first:

  • Headline and text copy
  • Page layouts
  • Images and videos
  • Call-to-action buttons
  • Loading delays

Review your results and keep optimizing your site over time. With Google Optimize, you can make data-driven improvements to boost conversions.

Let me know if you have any other questions! I‘m always happy to help fellow webmasters implement tools like Optimize.

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.