You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
referer-parser is a multi-language library for extracting marketing attribution data (such as search terms) from referer URLs, inspired by the [ua-parser][ua-parser] project (an equivalent library for user agent parsing).
6
6
7
-
referer-parser is a core component of [Snowplow][snowplow], the open-source web-scale analytics platform powered by Hadoop, Hive and Redshift.
7
+
referer-parser is a core component of [Snowplow][snowplow], the open-source web-scale analytics platform powered by Hadoop and Redshift.
8
8
9
9
_Note that we always use the original HTTP misspelling of 'referer' (and thus 'referal') in this project - never 'referrer'._
10
10
@@ -13,7 +13,10 @@ _Note that we always use the original HTTP misspelling of 'referer' (and thus 'r
for (r <-Parser.parse(refererUrl, pageUrl, internalDomains)) {
76
+
println(r.medium) // => "internal"
77
+
for (s <- r.source) {
78
+
println(s) // => null
79
+
}
80
+
for (t <- r.term) {
81
+
println(t) // => null
82
+
}
83
+
}
84
+
```
85
+
61
86
For more information, please see the Java/Scala [README][java-scala-readme].
62
87
63
88
## Usage: Ruby
@@ -116,6 +141,35 @@ r = Referer(referer_url, curr_url)
116
141
117
142
For more information, please see the Python [README][python-readme].
118
143
144
+
## Usage: node.js
145
+
146
+
The node.js (JavaScript) version of this library uses a hybrid of the new and old API, and identifies search, social, webmail, internal and unknown referers:
147
+
148
+
Create a new instance of a Referer object by passing in the url you want to parse:
For more information, please see the Go [README][go-readme]
244
+
140
245
## referers.yml
141
246
142
247
referer-parser identifies whether a URL is a known referer or not by checking it against the [`referers.yml`][referers-yml] file; the intention is that this YAML file is reusable as-is by every language-specific implementation of referer-parser.
@@ -168,7 +273,7 @@ The number of referers and the domains they use is constantly growing - we need
168
273
We welcome contributions to referer-parser:
169
274
170
275
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
171
-
2. **Ports of referer-parser to other languages** - we welcome ports of referer-parser to new programming languages (e.g. JavaScript, PHP, Go, Haskell)
276
+
2. **Ports of referer-parser to other languages** - we welcome ports of referer-parser to new programming languages (e.g. Lua, Go, Haskell, C)
172
277
3. **Bug fixes, feature requests etc** - much appreciated!
173
278
174
279
**Please sign the [Snowplow CLA] [cla] before making pull requests.**
@@ -183,21 +288,30 @@ You can contact the Snowplow Analytics team through any of the [channels listed
183
288
184
289
`referers.yml`is based on [Piwik's] [piwik] [`SearchEngines.php`] [piwik-search-engines] and [`Socials.php`] [piwik-socials], copyright 2012 Matthieu Aubry and available under the [GNU General Public License v3] [gpl-license].
185
290
186
-
The original Ruby code is copyright 2012-2013 Snowplow Analytics Ltd and is available under the [Apache License, Version 2.0] [apache-license].
291
+
The original Ruby code is copyright 2012-2014 Snowplow Analytics Ltd and is available under the [Apache License, Version 2.0] [apache-license].
292
+
293
+
The Java/Scala port is copyright 2012-2014 Snowplow Analytics Ltd and is available under the [Apache License, Version 2.0] [apache-license].
294
+
295
+
The Python port is copyright 2012-2014 [Don Spaulding] [donspaulding] and is available under the [Apache License, Version 2.0] [apache-license].
296
+
297
+
The node.js (JavaScript) port is copyright 2013-2014 [Martin Katrenik] [mkatrenik] and is available under the [Apache License, Version 2.0] [apache-license].
187
298
188
-
The Java/Scala port is copyright 2012-2013 Snowplow Analytics Ltd and is available under the [Apache License, Version 2.0] [apache-license].
299
+
The .NET (C#) port is copyright 2013-2014 [iPerform Software] [iperform] and is available under the [Apache License, Version 2.0] [apache-license].
189
300
190
-
The Python port is copyright 2012-2013 [Don Spaulding] [donspaulding] and is available under the [Apache License, Version 2.0] [apache-license].
301
+
The PHP port is copyright 2013-2014 [Lars Strojny] [tsileo] and is available under the [MIT License] [mit-license].
191
302
192
-
The .NET port is copyright 2013 [iPerform Software] [iperform] and is available under the [Apache License, Version 2.0] [apache-license].
303
+
The Go port is copyright 2014 [Thomas Sileo] [lstrojny] and is available under the [MIT License] [mit-license].
0 commit comments