In the digital marketplace, standing still is the same as moving backward. The most successful businesses are not those built on guesswork but on a foundation of empirical data. This is where A/B testing, a methodical approach to comparing two versions of a webpage to see which one performs better, becomes the most critical tool in your conversion rate optimization (CRO) arsenal. You are not just changing a button color or rewriting a headline; you are conducting a scientific experiment to understand user behavior and systematically improve results.
This article serves as your direct, technical, and actionable guide to harnessing the power of Matomo A/B testing. We will move beyond abstract theories and dive into the practical steps required to set up, launch, and analyze experiments within Matomo’s powerful, privacy first framework. By the end of this article, you will have the knowledge to transform your website from a static brochure into a dynamic engine for growth, all driven by the concrete insights that only a robust Matomo A/B testing strategy can provide.
Why Choose Matomo for A/B Testing? Key Advantages Over Alternatives

When you decide to start A/B testing, you face a choice of platforms. While many options exist, Matomo presents a compelling case for businesses that prioritize data accuracy, privacy, and seamless integration. The decision to use Matomo for A/B testing is a strategic one, offering distinct advantages that can fundamentally change how you view your website data. Let’s break down the core differentiators that set Matomo apart from common alternatives like Google Analytics and Google Optimize.
First and foremost is the principle of data ownership and privacy. In an era where consumer data privacy is not just a preference but a legal requirement (think GDPR and CCPA), using Matomo gives you full control. When you use Matomo On Premise, all the data you collect resides on your own servers. You are not sending sensitive user behavior information to a third party tech giant whose business model relies on aggregating and using that data.
This is a powerful statement to make to your customers. It shows you respect their privacy. For businesses in sensitive industries like healthcare or finance, this level of control is not just an advantage; it is a necessity. Matomo Cloud also offers a privacy focused alternative, hosted in Europe, ensuring compliance with the strictest privacy laws. This contrasts sharply with services that may use your data for their own purposes, giving you peace of mind and building trust with your user base.
Another significant technical advantage is the absence of data sampling. Data sampling is a practice used by some analytics platforms, including Google Analytics in its free version, to speed up report processing. Instead of analyzing all your traffic data, the platform analyzes a smaller subset and then extrapolates the results. For a website with high traffic, this means decisions are based on an educated guess, not on complete information.
This can lead to inaccurate conclusions, especially when the margins for your A/B test are slim. The Matomo A/B testing system operates on 100% of your data. Every visitor, every click, and every conversion included in your experiment is counted. This ensures that your results are as accurate as possible, giving you the confidence to make critical business decisions based on what really happened, not an approximation.
Seamless integration is another core benefit. With many platforms, A/B testing is a feature that feels bolted on, requiring separate tools or complex integrations to connect your experiments with your core analytics goals. The Matomo A/B testing feature is a native part of the platform. This means your experiments are intrinsically linked to all your other analytics data. You can effortlessly tie an A/B test to conversion goals, e-commerce tracking, and custom funnels that are already set up in your Matomo dashboard.
Do you want to see how a new homepage design affects not just clicks, but the entire user journey from landing page to checkout? With Matomo A/B Testing, that data is connected from the start. This deep integration allows for a much richer analysis, helping you understand the full impact of your changes on user behavior across the entire site.
Finally, let’s consider the cost effectiveness. The value proposition of Matomo is compelling. For those with the technical resources, Matomo On Premise is free and open source software. You pay for your own hosting, but the powerful analytics and Matomo A/B testing features come without a subscription fee. You only pay for premium features you choose to add. For those who prefer a managed solution, Matomo Cloud offers competitive pricing tiers.
When you compare this to the cost of other premium analytics and A/B testing suites, which can run into thousands of dollars per month, Matomo often emerges as the more financially sustainable option, especially for small and medium sized businesses that need enterprise level tools without the enterprise level price tag. The choice to use Matomo A/B testing is a choice for data ownership, accuracy, and integrated power.
Foundational Prerequisites: What You Need Before Starting

Before you can launch your first Matomo A/B testing experiment, you need to ensure your foundation is solid. Jumping in without the proper setup is a recipe for frustration and unreliable data. Taking a few moments to run through this technical checklist will ensure a smooth process from hypothesis to conclusion.
First, you must have an active Matomo instance. This could be Matomo On Premise, which you host on your own servers, or Matomo Cloud, the subscription based service. If you are using the On Premise version, it is crucial to ensure it is updated to a recent version, as features and stability are constantly improving. The A/B testing functionality is available as a premium feature from the Matomo Marketplace, so you will need to have it installed. For Matomo Cloud users, this feature is typically included in your plan, but it is wise to double check your subscription level.
Second, you need the right permissions. To create and manage experiments, you must have administrator level or “Super User” access to your Matomo dashboard. This level of access is required to install plugins (for On Premise), configure new experiments, and access the embed codes needed to run the test on your website. If you are part of a larger team, you may need to coordinate with your IT department or the primary Matomo administrator to get the necessary permissions.
Third, you must have access to your website’s source code or a tag management system. The Matomo A/B testing system works by adding a small snippet of JavaScript code to your website. You need to be able to place this code on the pages you intend to test. This can be done by directly editing your website’s HTML files, using a WordPress plugin that allows you to add scripts to the header, or, most efficiently, through a tool like the Matomo Tag Manager. Using a tag manager is the recommended approach as it allows you to manage and deploy scripts without needing to edit the website code for every change.
Fourth, and critically, you need clearly defined conversion goals already configured in Matomo. An A/B test is meaningless without a way to measure success. You cannot know if version B is better than version A if you have not defined what “better” means. A conversion goal could be anything that signifies a desired user action: a visitor submitting a contact form, a customer completing a purchase, someone clicking a “Download PDF” button, or even just visiting a specific key page. Before you even think about creating an experiment, these goals must be set up and tracking correctly within your Matomo analytics.
Finally, you need a strong hypothesis to test. A hypothesis is not just a random idea; it is a clear, testable statement that frames your experiment. A weak idea is “Let’s change the homepage.” A strong hypothesis is “Changing the main call to action button on the homepage from blue to bright orange will increase clicks on the button, leading to a 15% increase in ‘Request a Demo’ form submissions.” This statement identifies the element to change, the proposed solution, and the specific metric you expect to improve. Without a clear hypothesis, you are just making random changes, not conducting a structured experiment.
Activating the A/B Testing Framework in Matomo

Once your prerequisites are in order, the next step is to ensure the A/B testing framework is active within your Matomo environment. The process differs slightly depending on whether you are using Matomo On Premise or Matomo Cloud, but both paths are straightforward. This step is the official starting point for unlocking the Matomo A/B testing capabilities.
For users of Matomo On Premise, the A/B testing feature is a premium plugin that you add to your core Matomo installation. To activate it, you will first need to navigate to the Matomo Marketplace. You can access this directly from your Matomo dashboard. Typically, you will find an icon that looks like a shopping cart or a link for the Marketplace in the main administration menu. Once inside the Marketplace, use the search bar to find the “A/B Testing” plugin.
After locating it, you will need to purchase and install it. The Marketplace will guide you through the process. Once the plugin is installed, you need to activate it. Go to the “Plugins” section under “System” in your Matomo settings. Find the newly installed A/B Testing plugin in the list and click the “Activate” button next to it. After a moment, the system will confirm the activation. You should then see a new menu item in your Matomo dashboard, usually on the left hand side, labeled “A/B Testing” or “Experiments.” This new menu is your gateway to creating and managing every Matomo A/B testing campaign.
For users of Matomo Cloud, the process is significantly simpler. The A/B testing feature is typically bundled with your subscription plan, meaning there is no separate installation required. It is already integrated into the platform. You just need to confirm that it is enabled for your account. In most cases, if it is part of your plan, it will be active by default. You can verify this by simply looking for the “A/B Testing” or “Experiments” link in your main navigation menu. If you see it, you are ready to go.
If for some reason you do not see it, you should check your Matomo Cloud subscription details or contact Matomo support to ensure the feature is included and enabled for your specific plan. The ease of activation for Cloud users is one of the key benefits of the managed platform, as it allows you to bypass the installation and focus directly on strategy.
Step-by-Step Guide: Creating Your First A/B Test in Matomo

With the framework active, you are ready for the most important part: creating your first experiment. This process is where your hypothesis turns into a live test. Follow these steps methodically to ensure your Matomo A/B testing setup is flawless.
Step 1: Navigate to the “Experiments” Dashboard
In your Matomo interface, locate and click on the “A/B Testing” or “Experiments” menu item. This will take you to the main dashboard where you can see all your active, scheduled, and completed tests. It’s the central command center for all your optimization efforts.
Step 2: Initiate a New Experiment
Find and click the button that says “Create new experiment.” This will launch the experiment setup wizard. The first thing you will be asked to do is give your experiment a descriptive name. Be specific, for example, “Homepage CTA Button Color Test – Blue vs. Orange.” You will also be asked to enter your hypothesis. Writing it down here helps keep the goal of the test clear for you and anyone else on your team.
Step 3: Configure Your Variations
This is where you define what your users will see. You will have the “Original” version (the control) and you will need to add at least one “Variation.” Matomo provides several ways to create these variations.
- HTML/CSS/JavaScript: This is the most common method for on page changes. Matomo provides an editor where you can directly input code to alter elements. For example, to change text, you might use JavaScript to select an element by its ID and change its inner HTML. To change a color, you would add some CSS. This method is incredibly flexible and allows for nearly any kind of on page modification.
- Redirect (Split URL Test): This option is used when you are testing two completely different page designs that exist on separate URLs. For instance, if you have completely redesigned a landing page and have it hosted at
www.example.com/new-landing-page
, you would use this option. You would enter that URL as your variation, and Matomo would split traffic between the original URL and the new one. This is ideal for major redesigns, not small tweaks.
Step 4: Define Your Target Audience
Here, you decide who will see your experiment. You will start by setting the percentage of your website visitors to include in the test. You can choose to include 100% of your visitors, or a smaller percentage if you want to limit the test’s exposure initially.
You can then add more specific targeting conditions. This is a powerful feature of Matomo A/B testing. For example, you can choose to run the experiment only on specific pages by targeting a URL. You could also target by device type (e.g., only mobile users), by traffic source (e.g., only visitors from Google search), or even by custom variables that you have set up. This precision ensures you are testing the right changes on the right audience.
Step 5: Select Your Success Metrics (Goals)
An experiment needs a goal. In this step, you will link your test to one or more of the conversion goals you have already configured in Matomo. You might have a primary goal, such as “Completed Checkout,” and secondary goals, like “Added to Cart.” You must select at least one goal. This tells Matomo how to measure success and determine a winner. The variation that achieves the highest conversion rate on your primary goal will be the one that is performing better.
Step 6: Set the Confidence Level
You will see a setting for “Confidence” or “Statistical Significance.” This is a statistical concept that ensures your results are reliable. A confidence level of 95% is the industry standard. It means that you can be 95% certain that the results are not due to random chance. While you can lower this, it is highly recommended to keep it at 95% or higher to ensure you are making decisions based on data, not noise.
Step 7: Launch the Experiment
Finally, the wizard will show you a summary of all your settings. Carefully review the name, variations, targeting, and goals. If everything looks correct, click the “Start experiment” button. Your experiment is now configured, but it is not live on your site yet. The next step is to implement the tracking code.
Implementing the Experiment Code on Your Website
Once you have created and launched an experiment in the Matomo dashboard, there is one final, crucial step: implementing the experiment code on your website. This small snippet of JavaScript is the bridge that connects your website to the Matomo A/B testing engine, allowing it to show different variations to your visitors and track their interactions.
First, you need to locate the embed code. After you start your experiment, Matomo will automatically generate the JavaScript code snippet you need. You can find this within the experiment’s management screen. It will be clearly labeled and presented in a text box for easy copying. This code is unique to each experiment you create.
Next, you need to decide on the implementation method. There are two primary ways to add this code to your site.
The first method is adding it directly to your website’s HTML. For the Matomo A/B testing system to work effectively and prevent what is known as “content flicker” (where the original content appears for a split second before the variation loads), the code must be placed inside the <head> tag of your HTML document. It should be placed as high up in the <head> tag as possible. If you are using a content management system like WordPress, this might involve editing your theme’s header.php file. While this method works, it can be cumbersome if you are not comfortable editing code, and it requires you to repeat the process for every new experiment.
The second, and highly recommended, method is to use a tag management system, such as the Matomo Tag Manager. A tag manager acts as a container for all the third party scripts on your website. Instead of editing your site’s code every time, you simply manage your scripts through the tag manager’s interface. To implement the experiment code this way, you would create a new “Custom HTML” tag in Matomo Tag Manager. You would then paste the experiment snippet into this tag. Next, you would create a trigger to tell the tag when to fire.
For an A/B test, you would typically set the trigger to fire on all pages where the experiment should run. Once you have configured the tag and trigger, you publish the container, and the experiment code is deployed to your site without ever touching the source code. This approach is more efficient, less error prone, and the standard for modern web development.
After you have added the code, you need to verify that it is working correctly. A simple way to do this is to visit the page where the experiment is supposed to be running. You can use your browser’s built in developer tools (usually opened by pressing F12). Go to the “Network” tab and refresh the page. You should see a request being made to your Matomo instance that relates to the A/B test.
Another way is to check the real time visitor log in your Matomo dashboard. You should see yourself as a visitor, and if the experiment is set up correctly, it may show an icon or label indicating that you have been included in an A/B test. Taking a moment to verify the implementation ensures that your test will collect data accurately from the very beginning.