UTM Link Parameter AB Testing Condition for Oxygen

Often when you're working on marketing campaigns, it is important to use link tracking to determine what ads and what sources are resulting in the most conversions. To take this a step further in Oxygen, we can do A/B testing by showing and hiding elements of vary kinds based on typical URL parameters such as UTM Campaign, Medium, Source, Term, and Content.

At the end of this post, you'll find the code snippet you can add to your website to use this condition as described in the rest of the article.

Google provides a fantastic URL builder tool that this condition is based on: https://ga-dev-tools.appspot.com/campaign-url-builder/

You'll notice that the tool is setup with 5 main parameters that you can fill in to fit your specific use case:

  • Source
  • Medium
  • Name
  • Term
  • Content

The tool requires you to use your website URL (destination URL) source, medium, and a name, with term and content as optional fields.

You can input whatever you need to into

Let's say you are running paid ads on Google for your clothing website and you want to track an ad promoting your spring sale for women's shoes and you're testing version 1 of the ad.
An example URL would look like this:

Based on the example above you'll notice after your destination URL, you have a ? followed by all the parameters you set in the tool.

Let's say for example that you want to show a blue button instead of an orange button on that landing page, only to those visitors that come from that specific ad, with those parameters in the URL. You simply use that full URL from the campaign builder tool as the ad's destination in your ads campaign and then move to Oxygen Builder.

In Oxygen, you simply choose the element you want to show, add the conditions using the built in conditions modal, choose the condition operator (and / or), add the data into each condition and now you will only see those elements on the front-end if those URL parameters are present in the users address bar on page load.

For instance, if your campaign source is Google, your first condition would be UTM Source = google.
Next, click Add Condition and if your medium is something like CPC, your next condition would be UTM Medium = cpc.

Note: This is case sensitive, so use all lowercase and no spaces to be consistent.

So, if the user visits your website by coming directly to your page, they will see your default button and the original image. But if they visit from your Google ad, they will now see the blue button and the new image.

Pretty neat, right? Hopefully this helps you take your marketing efforts to the next level!

Signup For Emails

Want to be notified when new tutorials are released? Signup below for our roundup emails. We promise not to spam and won't blow up your inbox. 
  • This field is for validation purposes and should be left unchanged.

Code Used In Tutorial

To download the code used in this template, please login or register.
Jonathan Jernigan, Founder
Permaslug and APEX Web Solutions

Join Permaslug

Membership Benefits Include:

  • Ultimate Oxygen Course
  • Ultimate Woocommerce Course
  • ACF Pro Course
  • Material Design Lite
  • Template Downloads
  • Community
  • And more!

More Posts

How to Use OxyNinja Core Framework and Classes

The OxyNinja Core Design set for Oxygen Builder is more than just some pre-built classes. It includes an entire Grid framework built right in, allowing you to create complex layouts with ease. Not only that,…
READ post

Free Sandbox Plugin, OxyNinja, Dynamic FAQ, and More

Trying something a bit different today! I'm mashing up a bunch of different Oxygen Builder tutorials, discussions, and plugin reviews into one stream. Some of this content I've wanted to cover but it didn't justify…
READ post

How to Build a Local Directory Membership Site in Oxygen Builder

We'll be building a brand new website that has a membership component to it using MemberPress, Advanced Custom Fields Pro, and Oxygen Builder along with filtering and map results via WP Grid Builder. This site…
READ post
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram