What are all possible values of the refr_medium field?


#1

We sometimes get the following question:

What are all possible values of the refr_medium field?

The possible values are:

  • NULL
  • internal
  • social
  • search
  • email
  • unknown

It’s NULL when the page view has no referrer.

It’s set to internal when the page URL and referrer URL have the same host, or when the referring domain is configured as internal: https://github.com/snowplow/snowplow/blob/master/3-enrich/config/enrichments/referer_parser.json

The other values are parsed according to the data in our referer-parsing project: https://github.com/snowplow/referer-parser/blob/master/resources/referers.yml

To find out which referrer mediums are most common, run:

SELECT
  refr_medium,
  count(*)
FROM atomic.events
GROUP BY 1
ORDER BY 2 DESC

#2

If there’s something missing from the referrers YAML file you can also edit that file, it’s in a relatively simple indented/hierarchical format - https://github.com/snowplow/referer-parser/blob/master/resources/referers.yml and submit a pull request if there’s an additional referrer that you think others would benefit from having defined.