PHPackages                             shapeways/referer-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. shapeways/referer-parser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shapeways/referer-parser
========================

Snowplow Refer(r)er parser for PHP

0.1.0(11y ago)03.9k↓50%MITPHPCI failing

Since Feb 1Pushed 10y ago35 watchersCompare

[ Source](https://github.com/Shapeways/referer-parser)[ Packagist](https://packagist.org/packages/shapeways/referer-parser)[ RSS](/packages/shapeways-referer-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

referer-parser
==============

[](#referer-parser)

Java/Scala: [![Build Status](https://camo.githubusercontent.com/a20c9d8a2a43654a8d7dc87e0c7726fbdefa2600b5cd4119be851798cafa46e0/68747470733a2f2f7472617669732d63692e6f72672f736e6f77706c6f772f726566657265722d7061727365722e706e67)](https://travis-ci.org/snowplow/referer-parser)

referer-parser is a multi-language library for extracting marketing attribution data (such as search terms) from referer URLs, inspired by the [ua-parser](https://github.com/tobie/ua-parser) [ua-parser](https://github.com/tobie/ua-parser) project (an equivalent library for user agent parsing).

referer-parser is a core component of [Snowplow](https://github.com/snowplow/snowplow) [snowplow](https://github.com/snowplow/snowplow), the open-source web-scale analytics platform powered by Hadoop and Redshift.

*Note that we always use the original HTTP misspelling of 'referer' (and thus 'referal') in this project - never 'referrer'.*

Maintainers
-----------

[](#maintainers)

- PHP: \[Yuehlin Chung\] [yuehlin](https://github.com/yuehlin) at Shapeways, Inc
- `referers.yml`: \[Snowplow Analytics\] [snowplow-analytics](http://snowplowanalytics.com)

Usage: PHP
----------

[](#usage-php)

The PHP version of this library uses the updated API, and identifies search, social, webmail, internal and unknown referers:

```
use Snowplow\RefererParser\Parser;

$parser = new Parser();
$referer = $parser->parse(
    'http://www.google.com/search?q=gateway+oracle+cards+denise+linn&hl=en&client=safari',
    'http:/www.psychicbazaar.com/shop'
);

if ($referer->isKnown()) {
    echo $referer->getMedium(); // "Search"
    echo $referer->getSource(); // "Google"
    echo $referer->getTerm();   // "gateway oracle cards denise linn"
}
```

For more information, please see the PHP \[README\] [php-readme](https://github.com/snowplow/referer-parser/blob/master/php/README.md).

referers.yml
------------

[](#referersyml)

referer-parser identifies whether a URL is a known referer or not by checking it against the \[`referers.yml`\] [referers-yml](https://github.com/snowplow/referer-parser/blob/master/resources/referers.yml) file; the intention is that this YAML file is reusable as-is by every language-specific implementation of referer-parser.

The file is broken out into sections for the different mediums that we support:

- `unknown` for when we know the source, but not the medium
- `email` for webmail providers
- `social` for social media services
- `search` for search engines

Then within each section, we list each known provider (aka `source`) by name, and then which domains each provider uses. For search engines, we also list the parameters used in the search engine URL to identify the search `term`. For example:

```
Google: # Name of search engine referer
  parameters:
    - 'q' # First parameter used by Google
    - 'p' # Alternative parameter used by Google
  domains:
    - google.co.uk  # One domain used by Google
    - google.com    # Another domain used by Google
    - ...
```

The number of referers and the domains they use is constantly growing - we need to keep `referers.yml` up-to-date, and hope that the community will help!

Contributing
------------

[](#contributing)

We welcome contributions to referer-parser:

1. **New search engines and other referers** - if you notice a search engine, social network or other site missing from `referers.yml`, please fork the repo, add the missing entry and submit a pull request
2. **Ports of referer-parser to other languages** - we welcome ports of referer-parser to new programming languages (e.g. Lua, Go, Haskell, C)
3. **Bug fixes, feature requests etc** - much appreciated!

**Please sign the \[Snowplow CLA\] [cla](https://github.com/snowplow/snowplow/wiki/CLA) before making pull requests.**

Support
-------

[](#support)

General support for referer-parser is handled by the team at Snowplow Analytics Ltd.

You can contact the Snowplow Analytics team through any of the \[channels listed on their wiki\] [talk-to-us](https://github.com/snowplow/snowplow/wiki/Talk-to-us).

Copyright and license
---------------------

[](#copyright-and-license)

`referers.yml` is based on \[Piwik's\] [piwik](http://piwik.org) \[`SearchEngines.php`\] [piwik-search-engines](https://github.com/piwik/piwik/blob/master/core/DataFiles/SearchEngines.php) and \[`Socials.php`\] [piwik-socials](https://github.com/piwik/piwik/blob/master/core/DataFiles/Socials.php), copyright 2012 Matthieu Aubry and available under the \[GNU General Public License v3\] [gpl-license](http://www.gnu.org/licenses/gpl-3.0.html).

The PHP port is copyright 2013-2014 \[Lars Strojny\] [lstrojny](https://github.com/lstrojny) and is available under the \[MIT License\] [mit-license](http://opensource.org/licenses/MIT).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4124d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dbad8df7b7faa595230a7263028870a474c3d112670332d303317a1a693e55b?d=identicon)[armela](/maintainers/armela)

![](https://www.gravatar.com/avatar/9fe82cf61bceb849a69e20458c9ab6f6293941fc6fe376397fbbc4a2e0139ee7?d=identicon)[shapeways\_dev](/maintainers/shapeways_dev)

---

Top Contributors

[![alexanderdean](https://avatars.githubusercontent.com/u/200511?v=4)](https://github.com/alexanderdean "alexanderdean (277 commits)")[![fblundun](https://avatars.githubusercontent.com/u/5892914?v=4)](https://github.com/fblundun "fblundun (42 commits)")[![lstrojny](https://avatars.githubusercontent.com/u/79707?v=4)](https://github.com/lstrojny "lstrojny (18 commits)")[![tsileo](https://avatars.githubusercontent.com/u/395031?v=4)](https://github.com/tsileo "tsileo (15 commits)")[![donspaulding](https://avatars.githubusercontent.com/u/7777?v=4)](https://github.com/donspaulding "donspaulding (14 commits)")[![mkatrenik](https://avatars.githubusercontent.com/u/887117?v=4)](https://github.com/mkatrenik "mkatrenik (11 commits)")[![swijnands](https://avatars.githubusercontent.com/u/1218969?v=4)](https://github.com/swijnands "swijnands (11 commits)")[![235](https://avatars.githubusercontent.com/u/649444?v=4)](https://github.com/235 "235 (5 commits)")[![jhirbour](https://avatars.githubusercontent.com/u/2355?v=4)](https://github.com/jhirbour "jhirbour (4 commits)")[![Tombar](https://avatars.githubusercontent.com/u/141697?v=4)](https://github.com/Tombar "Tombar (3 commits)")[![emilssolmanis](https://avatars.githubusercontent.com/u/663720?v=4)](https://github.com/emilssolmanis "emilssolmanis (3 commits)")[![ygzgxyz](https://avatars.githubusercontent.com/u/249795?v=4)](https://github.com/ygzgxyz "ygzgxyz (2 commits)")[![kingo55](https://avatars.githubusercontent.com/u/2361388?v=4)](https://github.com/kingo55 "kingo55 (1 commits)")[![KaibinHuang](https://avatars.githubusercontent.com/u/3959479?v=4)](https://github.com/KaibinHuang "KaibinHuang (1 commits)")[![NikolayFrantsev](https://avatars.githubusercontent.com/u/837039?v=4)](https://github.com/NikolayFrantsev "NikolayFrantsev (1 commits)")[![rgraff](https://avatars.githubusercontent.com/u/8323?v=4)](https://github.com/rgraff "rgraff (1 commits)")[![gpby](https://avatars.githubusercontent.com/u/8070684?v=4)](https://github.com/gpby "gpby (1 commits)")[![tailhook](https://avatars.githubusercontent.com/u/321799?v=4)](https://github.com/tailhook "tailhook (1 commits)")[![FrancoisConstant](https://avatars.githubusercontent.com/u/218764?v=4)](https://github.com/FrancoisConstant "FrancoisConstant (1 commits)")[![denka](https://avatars.githubusercontent.com/u/1197116?v=4)](https://github.com/denka "denka (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shapeways-referer-parser/health.svg)

```
[![Health](https://phpackages.com/badges/shapeways-referer-parser/health.svg)](https://phpackages.com/packages/shapeways-referer-parser)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
