Skip to main content

Referer parser enrichment

This enrichment uses snowplow referer-parser library to extract attribution data from referer URLs.

Knowing which sites refer users to our website is very much a staple of analytics in order to help understand traffic patterns. This enrichment takes the value of the referring URL and matches it against the company/site it belongs to.

This is particularly useful when looking for specific traffic from search engine providers or social networks for instance. Rather than scouring a full referrer URL list this enrichment adds an additional field so that it's possible to look at reports that combine sub-domains from some of the bigger referrers.

Configuration

Testing with Micro

Unsure if your enrichment configuration is correct or works as expected? You can easily test it using Snowplow Micro on your machine. Follow the Micro usage guide to set up Micro and configure it to use your enrichment.

Snowplow has several subdomains like console.snowplowanalytics.com and discourse.snowplowanalytics.com. As users move from these subdomains to our main snowplowanalytics.com domain, we would like to capture that traffic as being referred internally. Therefore we would set the configuration as such:

"internalDomains": [
"console.snowplowanalytics.com",
"discourse.snowplowanalytics.com"
],

Enabling this enrichment with the above configuration would fill the refr_medium column in our data warehouse with “Internal” (rather then "Unknown") when the referring URL to a page matches the subdomains above.

Output

This enrichment populates the following fields of the atomic event :

FieldPurpose
refr_mediumType of referer. Examples : Search, Internal, Unknown, Social, Email
refr_sourceName of referer if recognised. Examples: Google, Facebook
refr_termKeywords if source is a search engine

With this information in the data warehouse it's possible to get such insights:

refr_mediumnumber of sessions
Search272,699
Internal142,555
Unknown127,335
Social14,525
Email5,345
Was this page helpful?