Target audiences by Referrer URL

  • Updated
  • Optimizely Feature Experimentation
  • Optimizely Full Stack (Legacy)
  • Optimizely Web Experimentation
  • Optimizely Performance Edge

The Referrer URL audience condition option lets you trigger an experiment based on the URL that your visitors came from, known as the referrer.

Typical use cases include setting audiences by the search engine the visitor uses, or excluding certain promotional referrers. The match types used for Referrer URL audience conditions are the same as the match types used for URL targeting in Optimizely Web Experimentation.

For advanced referrer targeting, you can capture a search term that led the visitors to your page. This requires limiting the URL match to a Regular Expression (regex) match to capture the search terms as provided by the various search engines. This works for Yahoo and Bing, but not Google, because Google does not use the 'q' parameter.

The following example shows what this might look if you are interested in targeting an experiment for any visitor that came to your page by entering the keyword "example" into their search engine:

  • http://search\.yahoo\.com/.*(p=.*example).*toggle
  • http://www\.bing\.com/.*(q=.*example).*go

The recorded referrer URL is the initial referrer or the originating URL. You can further define this as the URL of a page outside the domain of the snippet that the visitor navigated from before landing on a page where the snippet is implemented.  

The referrer URL is defined by Optimizely Web Experimentation at the time when a visitor first comes in contact with the snippet, not an experiment. Even if there is no experiment present at the time the visitor comes in contact with the snippet, the visitor object recognizes the URL from the previous domain page a visitor migrated from.

When troubleshooting this issue, use the visitor object from the JavaScript API: window["optimizely"].get("visitor");

Look under events to find what URL Optimizely Web Experimentation has defined as the 'referrer' URL for the visitor: