File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,28 @@ for (r <- Parser.parse(refererUrl, pageUrl)) {
61
61
}
62
62
```
63
63
64
+ You can also provide a list of domains which should be considered internal:
65
+
66
+ ``` scala
67
+ val refererUrl = " http://www.subdomain1.snowplowanalytics.com"
68
+ val pageUrl = " http://www.snowplowanalytics.com"
69
+ val internalDomains = List (
70
+ " www.subdomain1.snowplowanalytics.com" , " www.subdomain2.snowplowanalytics.com"
71
+ )
72
+
73
+ import com .snowplowanalytics .refererparser .scala .Parser
74
+
75
+ 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
+
64
86
For more information, please see the Java/Scala [ README] [ java-scala-readme] .
65
87
66
88
## Usage: Ruby
Original file line number Diff line number Diff line change @@ -87,6 +87,28 @@ for (r <- Parser.parse(refererUrl, pageUrl)) {
87
87
}
88
88
```
89
89
90
+ You can also provide a list of domains which should be considered internal:
91
+
92
+ ``` scala
93
+ val refererUrl = " http://www.subdomain1.snowplowanalytics.com"
94
+ val pageUrl = " http://www.snowplowanalytics.com"
95
+ val internalDomains = List (
96
+ " www.subdomain1.snowplowanalytics.com" , " www.subdomain2.snowplowanalytics.com"
97
+ )
98
+
99
+ import com .snowplowanalytics .refererparser .scala .Parser
100
+
101
+ for (r <- Parser .parse(refererUrl, pageUrl, internalDomains)) {
102
+ println(r.medium) // => "internal"
103
+ for (s <- r.source) {
104
+ println(s) // => null
105
+ }
106
+ for (t <- r.term) {
107
+ println(t) // => null
108
+ }
109
+ }
110
+ ```
111
+
90
112
### Installation
91
113
92
114
Add this to your SBT config:
You can’t perform that action at this time.
0 commit comments