雪崩 / referer-parser
Snowplow Refer(r)er解析器,适用于PHP
Requires (Dev)
- phpunit/phpunit: 3.*
- symfony/yaml: *
Suggests
- symfony/yaml: Support for YAML configuration file
This package is not auto-updated.
Last update: 2024-09-14 14:06:04 UTC
README
referer-parser是一个用于从来源URL中提取营销归因数据(如搜索词)的数据库,受ua-parser项目(一个用于用户代理解析的等效库)的启发。
referer-parser项目还包含多个库,用于在不同语言中与referer-parser数据库一起工作。
referer-parser是开源网络分析平台Snowplow的核心组件,该平台由Hadoop和Redshift提供支持。
请注意,在这个项目中,我们始终使用原始HTTP拼写错误的'referer'(以及'referal'),而不是'referrer'。
数据库
数据库以YAML和JSON格式提供。
最新数据库始终可在以下URL上找到
https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-latest.yaml https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-latest.json
数据库最多每月更新一次。每个数据库的新版本也会附带时间戳
https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-YYYYMMDD.yaml https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-YYYYMMDD.json
示例:https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-20200331.yaml https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-20200331.json
如果数据库出现问题,需要在一个月内重新发布,则相应的文件将被覆盖。
特定语言的存储库
- Scala: https://github.com/snowplow-referer-parser/scala-referer-parser
- Java: https://github.com/snowplow-referer-parser/java-referer-parser
- Ruby: https://github.com/snowplow-referer-parser/ruby-referer-parser
- Python: https://github.com/snowplow-referer-parser/python-referer-parser
- NodeJS: https://github.com/snowplow-referer-parser/nodejs-referer-parser
- .NET: https://github.com/snowplow-referer-parser/dotnet-referer-parser
- PHP: https://github.com/snowplow-referer-parser/php-referer-parser
- Golang: https://github.com/snowplow-referer-parser/golang-referer-parser
- Erlang: https://github.com/silviucpp/refererparser
referers.yml
referer-parser通过对照referers.yml
文件来识别一个URL是否为已知的引用者;目的是使这个YAML文件可以被referer-parser的每种语言特定实现直接重用。
该文件被拆分为我们支持的不同媒介的各个部分
- 当我们知道来源,但不知道媒介时使用
unknown
- 使用
email
表示网络邮件提供商 - 使用
social
表示社交媒体服务 - 使用
search
表示搜索引擎
在每个部分内部,我们按名称列出每个已知的提供者(也称为source
),然后列出每个提供者使用的域名。对于搜索引擎,我们还会列出用于在搜索引擎URL中识别搜索term
的参数。例如
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 - ...
引用者和它们使用的域名的数量一直在增长——我们需要保持referers.yml
的更新,并希望社区能够提供帮助!
贡献
我们欢迎对referer-parser的贡献
- 新搜索引擎和其他引用者——如果您注意到
referers.yml
中缺少了某个搜索引擎、社交网络或其他网站,请fork存储库,添加缺失条目并提交pull请求 - 将referer-parser移植到其他语言——我们欢迎将referer-parser移植到新的编程语言(例如Lua、Go、Haskell、C)
- 错误修复、功能请求等——非常感谢!
在提交pull请求之前,请签署Snowplow CLA。
支持
referer-parser的一般支持由Snowplow Analytics Ltd.团队处理。
您可以通过他们在维基上列出的任何渠道联系Snowplow Analytics团队。
版权和许可
referers.yml
基于Piwik的SearchEngines.php
和Socials.php
,版权所有2012 Matthieu Aubry,在GNU通用公共许可证v3下可用。