The Referral Source control allows you to configure block visibility based on the referral source URL. You can restrict visibility by specific domains, complete URLs, or URL fragments. You can also display dynamic content as users navigate between pages on your own website.
There are many applications for the Referral Source control. Here are a few examples to get you started.
- Display unique promotions to website visitors arriving from specific domains.
- Display dynamic messaging to users depending on how they navigate through your own website. For example, if a user navigates back to the homepage from the shopping cart page, perhaps prompt them with a message like: “Do you need any help completing your order?”
- When visitors from social media websites arrive at your site, prompt them to “like” and “share” your content.
How to Enable
Click on any block in the Block Editor and navigate to the Visibility panel. You will notice an ellipsis icon in the Controls Toolbar. See the screenshot below. Click on the ellipsis, and all available visibility controls will appear. Select “Referral Source” and the Referral Source control panel will be added to the selected block.
How to Configure
Instructions are always better with examples. Let’s assume you own a hotel. On your website, you want to encourage visitors from Expedia.com to book directly, which will save you on fees. You have created your call to action, and now you need to configure the block to be visible if the user is visiting from “expedia.com”.
Steps to Complete
- Navigate to the Referral Source control settings in the Visibility panel.
- Navigate to the Referral URL Contains text area.
- Add “expedia.com”.
The resulting configuration should resemble the screenshot below.
How to Disable
If you would like to disable the Referral Source control at the block level, simply click on the ellipsis icon in the Controls Toolbar and deselect it. That said, if you don’t think you will need this control on your website at all, it can be disabled globally in the Visibility Control Settings.
Note that if this control is disabled globally, any blocks that are actively being hidden by the Referral Source control will become visible again.
Below are the setting available to the Referral Source control. For the control to work properly, only enter one value per line in each textbox.
Referral URL Contains
The block will only be shown if the referral source URL contains at least one of the provided values.
Referral URL Does Not Contain
The block will be hidden whenever at least one of the provided values is present in the referral source URL. The “Does Not Contain” values take precedence over the “Contains” values when determining block visibility.
Show if no referral URL
Sometimes a referral source URL will not be available. There are a number of reasons for this. Click the learn more link below for more information. This setting allows you to decide what should happen if a referral source URL is not available. By default, the block will be hidden if the Referral Source control is enabled.
Detecting the domain referrer URL can be tricky. There are instances when the referrer will not be detected, or the browser will prevent it from being detected. If your referral condition is not working for a specific block, it might be due to one of the following reasons.
HTTPS → HTTP
The Referral control will not work if the referral source uses HTTPS protocol and your website is not secure and only uses HTTP. If this is the case, we recommend creating a custom link and using the Query String control. Below is a quick reference guide.
- HTTPS → HTTP – Will not work
- HTTPS → HTTPS – Should work
- HTTP → HTTP – Should work
rel Link Attributes
Some websites choose not to pass on referral information. This can be done by adding the
rel="noreferrer" attribute to any link. If you’re having trouble, double-check the link markup on the referring site to ensure this attribute is not set. If it is, you will need to request the website admin to remove it or consider using the Query String control instead.
Double-check that the referral URL that you have set is actually the correct referral URL. Some websites, notably social media sites like Twitter, use URL shorteners. So while you might think that setting
twitter.com would display the block to all visitors from Twitter. You actually want to use
Can’t Detect the HTTP Referrer?
If the block cannot detect the referral URL due to one of the above reasons, The Referral control includes the option to Show if there is no referral URL. You can toggle this option on and off at the block level. This gives you a fallback option if the referral URL can’t be detected.