-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
TrackingParameterRemover.kt
105 lines (102 loc) · 2.1 KB
/
TrackingParameterRemover.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package com.chimbori.crux.plugins
import com.chimbori.crux.api.Rewriter
import okhttp3.HttpUrl
public class TrackingParameterRemover(private val trackingParameters: Array<String> = TRACKING_PARAMETERS) : Rewriter {
override fun rewrite(url: HttpUrl): HttpUrl = url.newBuilder().apply {
url.queryParameterNames.filter { it in trackingParameters }.forEach {
removeAllQueryParameters(it)
}
}.build()
public companion object {
public val TRACKING_PARAMETERS: Array<String> = arrayOf(
"__hsfp",
"__hssc",
"__hstc",
"__s",
"_hsenc",
"_hsmi",
"_openstat",
"action_object_map",
"action_ref_map",
"action_type_map",
"cvid",
"dclid",
"fb_action_ids",
"fb_action_types",
"fb_ref",
"fb_source",
"fbclid",
"ga_campaign",
"ga_content",
"ga_medium",
"ga_place",
"ga_source",
"ga_term",
"gbraid",
"gclid",
"gs_l",
"hsa_acc",
"hsa_ad",
"hsa_cam",
"hsa_grp",
"hsa_kw",
"hsa_mt",
"hsa_net",
"hsa_src",
"hsa_tgt",
"hsa_ver",
"hsCtaTracking",
"ICID",
"igshid",
"mc_cid",
"mc_eid",
"mkt_tok",
"ml_subscriber",
"ml_subscriber_hash",
"msclkid",
"oicd",
"oly_anon_id",
"oly_enc_id",
"otc",
"rb_clickid",
"s_cid",
"soc_src",
"soc_trk",
"stm_campaign",
"stm_cid",
"stm_content",
"stm_medium",
"stm_name",
"stm_reader",
"stm_referrer",
"stm_social",
"stm_social-type",
"stm_source",
"stm_term",
"twclid",
"utm_brand",
"utm_campaign",
"utm_cid",
"utm_content",
"utm_id",
"utm_medium",
"utm_name",
"utm_place",
"utm_pubreferrer",
"utm_reader",
"utm_referrer",
"utm_social",
"utm_social-type",
"utm_source",
"utm_swu",
"utm_term",
"utm_userid",
"utm_viz_id",
"vero_conv",
"vero_id",
"wbraid",
"wickedid",
"yclid",
)
}
}