How to Target Campaigns to URLs with Query Arguments

OptinMonster can present targeted offers to readers based on the query parameters present in the page’s URL. Additionally, you can use the URL Parameter rule to retarget visitors for additional marketing or upselling.

NOTE: This guide will show you how to effectively use the Display Rule: Visitors with a specific URL parameter.
REQUIREMENT: You’ll need at least Pro subscription to use the URL Parameter targeting rule. If you don’t already have a Pro subscription, upgrade your subscription first, then come back and follow along to learn how you can target users based on their URL Parameters.
WARNING: Not all website follow the same URL structure shown in the example below. For example, some sites will display search results as http://example.com/?q=my+search+term or without a query string at all. Please examine your own website to find the URL structure to use in your display rules.

What is a Query Argument?

A query argument (also called a query string) is a small snippet of code added to your URL which further processes the url being viewed.

A query argument has two parts: the query argument key, and the query argument value.

The structure of a URL with a query argument looks like this:

http://domain.com/?key=value

The Display Rule “Visitors with a specific URL parameter” allows you to target these keys and values when choosing where and when your campaigns should display. Every key must have a matching value.

URL-parameters_-key-and-value

You have the following conditions available when targeting Query Arguments:

  • exactly matches
  • does not exactly match
  • contains
  • does not contain
  • starts with
  • ends with
  • is anything
  • matches the pattern

These conditions allows you very fine grain control over what campaigns are displayed in response to your specific query arguments.


Examples of How to Use the Page Targeting Rule

E-Commerce
WARNING: Not all e-commerce sites follow the same URL structure shown in the example below. For example, some sites will use http://example.com/checkout/cart/add?product=2880&qty=2 to add a product directly to a cart. Please examine your own e-commerce platform to find the URL structure to use in your display rules.
The URL below adds the product with the ID 532 to the shopping cart of an e-commerce website. When visited, the product will be automatically added to the cart, and the user will be able to proceed to checkout.

http://www.example.com/checkout/?add-to-cart=532

The URL has one query argument key, and one query argument value.

Key: add-to-cart Value: 532

Perhaps you’d like to show a campaign with an upsell specific to the product ID 532 once someone adds that product to their cart. You can do that using the Display Rule, configured as shown below:

URL-parameters-_-add-to-cart-and-532

WARNING: Not all website follow the same URL structure shown in the example below. For example, some sites will display search results as http://example.com/?q=my+search+term or without a query string at all. Please examine your own website to find the URL structure to use in your display rules.
Offer targeted campaigns to readers searching for specific content on your site using the Query Parameters rule. For most websites, the query string for searches looks like something like this:

https://optinmonster.com/?s=content+upgrades

In this example, the reader searched for “content upgrades” at https://optinmonster.com and was shown a list of every article or page on the site containing the words “content upgrades.” This would be a great opportunity to share an offer for an ebook related to content upgrades.

For the URL above, there is one query argument key and one query argument value.

Key: s Value: content+upgrades

URL-parameters-_-s-and-product-upgrades

Post Types
WARNING: Not all website follow the same URL structure shown in the example below. For example, some sites will display custom content types as http://example.com/tours. Please examine your own website to find the URL structure to use in your display rules.

If your site offers multiple post types, you can target campaigns to display only when those post types are being viewed. OR, in this example, to display when those post types are NOT being viewed.

In this example, we’ll see how you can use the conditions of the Query Parameter rule to further refine where a campaign displays.

http://example.com/?post_type=tours

The URL above will display only posts of the post_type “tours.” It has one query argument key and one query argument value.

Key: post_type Value: tours

If you’d like a campaign to display on every post type, but not on tours, you can do that using the Query Parameter Display Rule. Simply adjust the conditions from “exactly matches” to “does not exactly match.”

URL-Parameters_-post-type-and-tours

NOTE: If you have any questions about how you might use our Query Parameter Display Rule for onsite retargeting, please feel free to send us a support ticket. We’re always happy to help!

Wondering how you can target your users even further? You can target a users web browser’s cookies for precision marketing.


Frequently Asked Questions

Q: How do I use the Matching the Pattern Rule?

A: You can learn more about our Matching the Pattern rule, which uses RegEx (Regular Expressions) by reading our Matching the Pattern guide.