In this article: About the referral source condition | Examples | Types of referral sources | How to set up a referral source condition using If-So.
The referral source condition lets you add or replace content on your website based on the domain or URL from which your visitors arrive at your site. The referral source can be a page on your own website, a URL around the web, or a whole domain.
Usage examples:
Possible Use Cases
Display different phone numbers in order to track the results of your marketing efforts or collaborations with different sites.
Display special promotions to visitors arriving from a chosen website
For your convenience, you can paste the following shortcode on your page. Then, visit the page by clicking the search result in Google (or any other search engine) to see the exact referrer.
[ifsoDKI type='referrer']
Click here to see your HTTP/HTTPS referrer.
Use the page on your website referral source condition to display custom content to visitors arriving from certain pages on your website. This option is useful for cross-selling, upselling, and bringing users back to the sales funnel.
*Elementor or Gutenberg user? This condition can be used to set up a conditional element or block (Learn more: Gutenberg | Elementor).
Use the Custom URL condition to display dynamic content to visitors arriving from certain websites or web pages.
Example: If → URL is → Google.com ⇒ Then → Display custom content
The referral source condition will not work when referring from Https protocol to Http protocol. If your website is on Http protocol, and the referrer is an Https website you can use the dynamic link condition instead.
The following table presents operators and actual referrals. It illustrates whether dynamic content will be displayed or not displayed if your website is on Http protocol
Operator | Domain/ URL/ Term set by the admin | Visitor’s actual Referrer | Result (Will dynamic content be displayed?) |
---|---|---|---|
URL is | shoes.com | http://shoes.com | Yes |
http://www.shoes.com | Yes – The condition is met whether you write www or not | ||
https://www.shoes.com | Yes – If your site uses an HTTPS protocol No – If your site uses an HTTP protocol |
||
https://shoes.com | Yes – If your site uses an HTTPS protocol No – If your site uses an HTTP protocol |
||
URL contains | shoes | http://shoes.com | Yes |
sh | http://shoes.com | Yes – It doesn’t matter where in the URL your letters appear | |
red | http://shoes.com/red | Yes – It doesn’t matter where in the URL your term appears | |
red | http://red.shoes.com | Yes – It doesn’t matter where in the URL your term appears | |
.com.de | http://shoes.com.de | Yes | |
URL is not | shoes.com | http://clothes.com | Yes |
URL does not contain | shoes | http://clothes.com | Yes |
Yes, If-So utilizes JavaScript’s document.referrer for the referral source condition, ensuring compatibility with caching without relying on cookies. If you are using page cache on your site, all you need to do is make sure to load the dynamic content using our ‘page caching compatibility’ (ajax=’yes’) mode.
*In the absence of ajax mode, it defaults to utilizing PHP’s $_SERVER[‘HTTP_REFERER’] global.
Yes.
Whether you are using a caching plugin or server caching, you can navigate to the plugin settings and enable the “Page Caching Compatibility” option. With the option enabled, dynamic triggers will be rendered in a separate request that will take place after the loading of the cached version.
Yes, you can set up conditional redirects based on any If-So condition. For a step-by-step guide, click here.