Update on April 15, 2020: Also added != operator.


This premium tutorial provides the steps to add a custom condition using which elements in Oxygen can be output based on the value of specific URL parameter like /?referrer=facebook.

Use Case

Let's say you want to output a section having for example, a welcome message on the front end only for users that visit your site from Facebook and you want to output another Section only for visitors that land on your Page after clicking through a link in Twitter.

To achieve this personalization, you could

  1. define "referrer" query variable in WordPress
  2. register a condition that returns true if the URL parameter matches with the one user enters in the condition
  3. set condition for your Oxygen sections i.e., enter facebook as the value of referrer URL parameter for the Facebook section and twitter as the value of referrer URL parameter for Twitter section.
  4. use referrer query variable in your URLs like example.com/?referrer=facebook and example.com/?referrer=twitter

Step 1

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: Add "referrer" query variable

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

You need to be logged in to view and post comments.
Not a member yet? Join here.
magnifiercross
>
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: