Referrer Detection: How to Target Visitors from Facebook, Google etc.

Referral detection / traffic source visitor targeting

MailOptin Referrer Detection lets you create targeted optin campaigns and messages shown to visitors referred to your WordPress site by specific URLs or traffic sources. For example, you can create a campaign targeted at visitors to your WordPress site from social media (such as Facebook, Twitter, Pinterest, LinkedIn, Instagram, and YouTube) or search engines (Google, Bing, Yahoo, DuckDuckGo).

It also works for UTM parameters. For example, you can hide or show an optin to users referred by a website or any website with a given UTM parameter.

Follow this guide to learn how to use this feature.

Create a new optin campaign or edit an existing one by clicking the campaign title or the Customize button to open the edit screen. In this example, we’ll be creating a lightbox/popup.

It’s worth noting that all optin types (including the sidebar, before/after post, slide-in, and notification bar) support Referrer Detection targeting.

MailOptin opt-in campaign listing

Open Display Rules >> Referrer Detection panel, activate the rule, and select whether to show or hide traffic sources specified in the “Referrers” field.

Referral detection / traffic source visitor targeting

To hide or show an optin to visitors or users referred by a website or URL with a UTM parameter of utm_source=newsletter, add it as a referrer like so:

Note / Tips

  • Google has a lot of domains, such as and depending on the location a user is searching from. To target referrers from all Google domains, use just google. without the TLD.
  • If you want to target visitors from Twitter, be sure to include besides because all links on Twitter are shortened to a “” link.
  • If referrer detection is active, the display type is set to Hide From specified referrers. The optin will be shown to users coming from any other referrer.
  • If a visitor comes directly to your site, that is, he didn’t click a link that referred him to your website, optin with referrer detection set to either show to or hide from won’t be shown to them because they have no referrer.