// Tutorial //
Knowledge Base

How to Use the URL Parameters Plugin for Enhanced Marketing Campaigns

Last updated: August 10, 2024

Introduction

In this guide, you will learn how to use the URL Parameters WordPress plugin. This powerful tool allows you to access URL parameters and display conditional content based on the Query String of the URL. This can be especially useful for tracking referral sources, personalizing user experiences, and dynamically managing content based on URL parameters.

Why Use URL Parameters?

URL parameters are essential for capturing additional insights about how and where your website traffic is coming from. They can help you:

  • Track referral sources (e.g., Google Ads campaigns)
  • Personalize content based on user information
  • Create dynamic landing pages that adapt to the user’s context

Installation

First, let’s get the plugin installed on your WordPress site.

  1. Upload the Plugin:
    • Download the URL Parameters plugin and upload the url-parameters folder to the /wp-content/plugins/ directory of your WordPress installation.
  2. Activate the Plugin:
    • Go to your WordPress dashboard, navigate to Plugins > Installed Plugins, find “URL Parameters,” and click Activate.

How to Use the Plugin

The URL Parameters plugin provides two shortcodes: [url_query] and [if_url_query].

Displaying URL Parameters

The [url_query] shortcode is used to display the value of a URL parameter. This is perfect for dynamically inserting campaign-specific information into your content.

Example Usage:

Suppose you want to greet users based on their city. You can use the following shortcode:

[url_query param="city" default="Cleveland"]
  • URL: https://yourwebsite.com/?city=New-York
  • Output: New York

If the city parameter is not set, it will default to “Cleveland.”

Conditional Content Based on URL Parameters

The [if_url_query] shortcode allows you to conditionally display content based on the value of a URL parameter. This can be used to tailor messages or offers to specific campaign sources or user segments.

Example Usage:

You have a summer campaign, and you want to display a special message only if the user comes from this campaign.

[if_url_query param="utm_campaign" is="summer"]Welcome to our Summer Campaign![/if_url_query]
  • URL: https://yourwebsite.com/?utm_campaign=summer
  • Output: Welcome to our Summer Campaign!

If the utm_campaign parameter is not "summer" nothing will be displayed.

Handling Empty Parameters

You can also use the [if_url_query] shortcode to display content if a parameter is empty or not set.

Example Usage:
Welcome visitors who haven’t specified their name in the URL.

[if_url_query param="FirstName" empty="1"]Welcome to the site, visitor![/if_url_query]
  • URL: https://yourwebsite.com/
  • Output: Welcome to the site, visitor!

If the FirstName parameter is set, this message will not be displayed.

Advanced Usage with Multiple Parameters

You can specify multiple parameters separated by commas. The plugin will check for each parameter in order until a matching one is found and return that. If no parameters match, the default will be returned.

Example Usage:
[url_query param="FirstName,first,name" default="Friend"]
  • URL: https://yourwebsite.com/?name=John
  • Output: John

If none of the parameters are set, it will default to “Friend.”

Practical Applications in Marketing

Personalizing Landing Pages

Use the plugin to personalize landing pages based on URL parameters from your marketing campaigns. For example, dynamically display the product name, discount offer, or personalized greeting based on campaign parameters.

[url_query param="product" default="our latest product"]
  • URL: https://yourwebsite.com/?product=SuperWidget
  • Output: SuperWidget

Tracking and Displaying Referral Sources

Show a tailored message or offer based on the referral source of your visitors.

[if_url_query param="utm_source" is="google"]Thanks for visiting us from Google![/if_url_query]

Conclusion

The URL Parameters plugin is a versatile tool that can significantly enhance your marketing campaigns by enabling personalized and dynamic content based on URL parameters. Whether you are tracking referral sources, personalizing user experiences, or creating dynamic landing pages, this plugin has you covered.

If you have any questions or need further assistance, please feel free to reach out to our support team.

Happy marketing!

Table of content

Related Content
Grow your
business with us
Start marketing with Marketing Done Right and together let’s build your brand.
We are a group of professional marketers, website builders, and developers with the goal of delivering high-quality services to our clients.
© 2024
Marketing Done Right, LLC. all rights reserved.