How to Use OptinMonster’s Referral Detection for Advanced Lead Targeting

OptinMonster makes it easy to show campaigns to visitors who have been referred to your site from another specific website.

In this article, you’ll learn how to use OptinMonster’s Referral Detection rule.

Before You Start

Here are some things to know before you begin:

  • Referral Detection targeting is available with a Pro or higher subscription.
  • This guide assumes you’re familiar with OptinMonster’s Display Rules.
  • Some situations you might find the Referral Detection rule especially useful include:
    • If you’re running a promotion with another website and want to show a targeted message only to visitors who reach your site through that promotion.
    • To show a specific message only to visitors who reach your site through social media, e.g. through Facebook, Twitter, Instagram, etc.
    • To hide campaigns from traffic who reach your site through another specific website.

Referral Detection Targeting

To target your campaign to visitors who have reached your site by clicking on a link from another specific website, follow these steps:

  1. In the campaign builder, navigate to the Display Rules view.
    Display Rules view in the OptinMonster campaign builder
  2. When adding a new Display Rule choose the Referral Targeting rule from the Targeting section.
    Referral Detection Display Rule in the OptinMonster Campaign builder
  3. From the dropdown field choose the specificity to use when matching the URL (e.g. “exactly matches”, “does not contain”, “matches the pattern“).
    Referral Detection operator
  4. Next, enter the URL you want to target in the field provided.
    Referral URL text field
  5. When you’re finished, click Save.

If you’re serious about jumpstarting your website 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 →


Can I use Referral Detection to hide/show campaigns to visitors arriving from my email newsletter?

No, however, you can follow our guide on how to hide OptinMonster from existing newsletter subscribers.

Referrer Detection isn’t working for my campaign, why?

Referrer Detection checks if a specific value has been passed as HTTP_REFERRER in the browser.

If the HTTP_REFERRER passed is empty then Referrer Detection will fail for your campaign and your campaign might not load as you expect.

There are several reasons the HTTP_REFERRER could be empty, including if the website visitor:

  • entered the site URL in the browser address bar itself
  • visited the site by a browser-maintained bookmark
  • visited the site as the first page in the window/tab
  • switched from a secure (HTTPS) site to a non-secure (HTTP) site
  • has security software installed (antivirus/firewall/etc) which strips the referrer from all requests
  • is behind a proxy which strips the referrer from all requests
  • visited the site programmatically without setting the referrer header
In all instances, we strongly recommend that you thoroughly test your campaign’s functionality when configuring referrer detection in the Display Rules to ensure your settings are working as expected.
Why doesn’t this work when the visitor switches from a secure (HTTPS) to a non-secure (HTTP) site?

By default, the referrer data is not passed when the visitor reaches a non-secure (HTTP) site from a secure (HTTPS) site.

For advanced users, if you have access to the site your visitors are coming from, you can resolve this issue by adding the following meta tag to the head of the secure (HTTPS) site.

This article about the Referrer Meta Tag provides context on how this works and examples of the various meta tags available for this purpose.