How to use URL parameters edit

There are a few ways we determine where a visitor comes from. We automatically detect the previous page (referrer) from the visitor’s browser, but you can also add a URL parameter to override this and set a custom referrer.

Using a URL parameter

If the current URL on your site includes a parameter named ref or utm_source, we use this value instead of the browser’s previous page.

For example, if you were to include this link in an email newsletter, Simple Analytics records the referrer as email in your dashboard, no matter where user actually comes from:

Forbidden characters

Certain character are not allowed in the URL parameter. Letters and numbers are always okay, but if you want to use special characters (like spaces, ;, /, ?, :, @, &, =, +, $, or ,) you need to escape your URL parameter. A good website that does this for you is

Valid examples of URL parameters:

Using the referrer URL

The referrer URL is only used if there are none of the URL parameters mentioned above

If there is no referral parameter found, we save the URL of the referring page from the visitor’s browser. We only save the part of the referrer before ? or #, so if the referrer URL is, we only store Note that the protocol (https://) is also removed. We also ignore common subdomains like www., m., l., and www2..

You don’t have to do anything to make this work.

Parsing of values

We parse the URL parameter differently than the referrer URL. Because you generate the URL parameters yourself, we don’t want to touch these too much. Instead, we decode their values (so you can use forbidden characters) and convert hostnames to more general names. For example, we convert to google. We still store the original value, but we show google as the referrer in the dashboard. We do this so we can combine similar referrers, such as,, and, into simply google.

Referrer URLs contain the full URL that the browser gives us, such as From this URL we store as the referrer and keep as the original URL. We drop the query (?query=sensitive+information), protocol (https://), and common subdomain (www.).