OptinMonster Documentation

Documentation, Reference Materials, and Tutorials for OptinMonster

Home

Docs

How to Target Campaigns to URLs with Query Arguments

How to Target Campaigns to URLs with Query Arguments

OptinMonster makes it easy to show or hide campaigns to visitors on your site based on the query arguments in the URL.

In this article, you’ll learn how to target campaigns to URLs with query arguments.

Before you start, this feature is available with a Pro and higher subscription.

Query argument is a specific portion of a web page’s URL, but not the full URL. The query argument comes after a question mark and before any anchors.
URL Structure

A URL can contain multiple sets of query arguments, separated by an ampersand like this: http://domain.com/?key=value&key2=value2&key3=value3

The term “query argument” is also sometimes called “query string” or “query parameters”.

The query argument rule is case-sensitive.

Query Argument Targeting

When you create a campaign in OptinMonster you can target URLs on your site that contain certain query arguments.

To show or hide your campaign on URLs with query arguments, follow these steps:

  1. Navigate to the Display Rules view in the campaign builder.
    Navigate to the Display Rules in the OptinMonster campaign builder.
  2. Next, when adding or editing a rule select Where (Targeting) from the left-hand list and select the Query Targeting option.
    Query Targeting rule in OptinMonster.
  3. Finally, enter the name of the key and value, if you’re doing any type of matching, into the provided fields.
    Query Argument Targeting options.
    You’ll have the following match options available:
    • Key only:
      • exists
      • does not exist
      • is empty (no query args)
      • is not empty (has query args)
    • Value only:
      • empty
      • not empty
      • is empty
      • is not empty
    • Key and Value:
      • exactly matches
      • does not exactly match
      • contains
      • does not contain
      • starts with
      • does not start with
      • ends with
      • does not end with
      • is anything
      • matches the pattern
  4. When you’re finished, Save the campaign.

Examples

Here are some examples to help you get started.

Marketing Campaign

If you run a marketing campaign like Google Adwords or an Email Campaign, each URL will contain UTM Parameters you can target. Our guide here shows how you can target campaigns to your pay-per-click marketing campaigns.

E-Commerce

If your e-commerce platform uses query arguments in the URL to add products to the shopping cart you could show a specific campaign when a visitor adds a specific product to their cart.

Let’s assume your e-commerce site uses a query argument structure like the following to add a product to the shopping cart:

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

When the above URL is visited on our example e-commerce store, the product with ID 532 is automatically added to the visitor’s shopping cart.

Now, we can target a campaign to show only when a URL with that query argument is visited. Perhaps we want to offer a specific upsell in the campaign when the product with ID 532 is added to the cart.

To do this, we’ll add a query arg rule to the Display Rules and enter the key and value with exactly matches condition.

Add to cart example using Query Argument Targeting in OptinMonster.

Site Search

Some websites will use query arguments in the URL to generate search results. If your website follows this convention you can use query argument targeting to show a specific campaign to visitors who search for a certain term.

For most websites, the query string for searches will look similar to the following:

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

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

Key: s
Value: content+upgrades

*The plus (+) sign typically represents a space between search terms since a URL cannot contain spaces.

Now, we can target a campaign to show only when a URL with that query argument is visited. This may be a good opportunity to show a campaign that offers a free ebook related to content upgrades.

To do this, we’ll add a query arg rule to the Display Rules and enter the key and value with exactly matches condition.

Search example using Query Argument Targeting in OptinMonster.

FAQs

Is this rule case-sensitive?

Yes, all operator conditions for the query argument rule are case-sensitive.

For example, the query argument key of ‘Hello’ is not the same as ‘hello’.

Be sure to check the case of your query arguments to be sure the Display Rule configured matches.


If you’re serious about jumpstarting your website business growth, then get started with OptinMonster today!

Get Started With OptinMonster Today!

BONUS: Done-For-You Campaign Setup ($297 value)

Our conversion experts will design 1 free campaign for you to get maximum results – absolutely FREE!

Click here to get started →


Still stuck?

How can we help?

Last updated on


Start Getting More
Leads & Sales Today
with OptinMonster!

Create and launch smart capture forms today in minutes. What are you waiting for?

Create and launch smart capture forms
today in minutes. What are you waiting for?

OptinMonster has transformed our business. Before integrating their optins, our clients saw a 2% conversion rate from web traffic, which is slightly above the standard for their industry. With the integration of OptinMonster’s lightbox popup, exit-intent technology, split testing, and other tools, our client’s conversion rates soared by an unprecedented 500%. They attracted substantially more customers while spending less on digital advertising. Their success propelled them to the top of their markets, outperforming national chains and other medical spas with much bigger marketing budgets. Our client’s success in their market has distinguished us in our own. We are now one of the most sought-after marketing firms in the industry of aesthetic medicine. We know that the integration of OptinMonster, more than any other tool or marketing strategy, has supported this growth and achievement.

chris zelig medstar media

Chris Zelig

Partner, Medstar Media

OptinMonster has been a game-changer for us. From driving donations to collecting new leads, there is nothing that this simple tool has failed to accomplish. Our lead collection rate has jumped by over 1,000%.

joe lowe american bird conservancy

Joe Lowe

Director of Digital Communications, American Bird Conservancy

Through OptinMonster’s exit-intent popups, we have more than doubled our sales conversion rate. Best of all is the compound effect of using OptinMonster over a long period of time—more conversions mean more customers, which means more word of mouth.

mitch smith, managing director, shockbyte

Mitch Smith

Managing Director, Shockbyte.com