@metarouter/ajs-starter-kit 1.0.46 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"153f38d38a806f6ce6f74c5982fe5f38"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"b595e137717755bf1031fcaa01ce64b5"
|
|
@@ -1,181 +1,3 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "v0.0.1"
|
|
3
|
-
"global": {
|
|
4
|
-
"filters": [
|
|
5
|
-
{
|
|
6
|
-
"byEventNames": {
|
|
7
|
-
"action": "allow",
|
|
8
|
-
"events": [
|
|
9
|
-
"identify",
|
|
10
|
-
"page",
|
|
11
|
-
"products_searched",
|
|
12
|
-
"product_list_viewed",
|
|
13
|
-
"product_viewed",
|
|
14
|
-
"product_added",
|
|
15
|
-
"cart_viewed",
|
|
16
|
-
"order_completed"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"enrichments": [
|
|
22
|
-
{
|
|
23
|
-
"outputKey": "timestamp",
|
|
24
|
-
"date": {
|
|
25
|
-
"format": "2006-01-02T15:04:05-0700"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"mappings": [
|
|
30
|
-
{
|
|
31
|
-
"inputKey": "anonymousId",
|
|
32
|
-
"outputKey": "cookie"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"inputKey": "userId",
|
|
36
|
-
"outputKey": "customer_id"
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
"eventSpecific": {
|
|
41
|
-
"identify": {
|
|
42
|
-
"enrichments": [
|
|
43
|
-
{
|
|
44
|
-
"staticString": "identify",
|
|
45
|
-
"outputKey": "event"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"mappings": [
|
|
49
|
-
{
|
|
50
|
-
"inputKey": "traits.email",
|
|
51
|
-
"outputKey": "email"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"inputKey": "traits.name",
|
|
55
|
-
"outputKey": "firstname"
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"page": {
|
|
60
|
-
"enrichments": [
|
|
61
|
-
{
|
|
62
|
-
"staticString": "pageload",
|
|
63
|
-
"outputKey": "event"
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
"mappings": [
|
|
67
|
-
{
|
|
68
|
-
"inputKey": "context.page.url",
|
|
69
|
-
"outputKey": "url"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"inputKey": "properties.referrer",
|
|
73
|
-
"outputKey": "referrer"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"inputKey": "context.ip",
|
|
77
|
-
"outputKey": "ip"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"inputKey": "context.userAgent",
|
|
81
|
-
"outputKey": "user_agent"
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
"products_searched": {
|
|
86
|
-
"enrichments": [
|
|
87
|
-
{
|
|
88
|
-
"staticString": "search",
|
|
89
|
-
"outputKey": "event"
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
"mappings": [
|
|
93
|
-
{
|
|
94
|
-
"inputKey": "properties.query",
|
|
95
|
-
"outputKey": "keywords"
|
|
96
|
-
}
|
|
97
|
-
]
|
|
98
|
-
},
|
|
99
|
-
"product_list_viewed": {
|
|
100
|
-
"enrichments": [
|
|
101
|
-
{
|
|
102
|
-
"staticString": "product_list_viewed",
|
|
103
|
-
"outputKey": "event"
|
|
104
|
-
}
|
|
105
|
-
],
|
|
106
|
-
"mappings": [
|
|
107
|
-
{
|
|
108
|
-
"inputKey": "properties.category",
|
|
109
|
-
"outputKey": "category"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"inputKey": "properties.list_id",
|
|
113
|
-
"outputKey": "list_id"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"inputKey": "properties.products",
|
|
117
|
-
"outputKey": "product_ids",
|
|
118
|
-
"transforms": [
|
|
119
|
-
{
|
|
120
|
-
"pluckValues": {
|
|
121
|
-
"extractKey": "product_id"
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
"product_viewed": {
|
|
129
|
-
"enrichments": [
|
|
130
|
-
{
|
|
131
|
-
"staticString": "view",
|
|
132
|
-
"outputKey": "event"
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
"mappings": [
|
|
136
|
-
{
|
|
137
|
-
"inputKey": "input",
|
|
138
|
-
"outputKey": "products",
|
|
139
|
-
"transforms": [
|
|
140
|
-
{
|
|
141
|
-
"expression": {
|
|
142
|
-
"lang": "lua",
|
|
143
|
-
"body": "return {{\n sku = input.properties.product_id,\n}}"
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
]
|
|
147
|
-
}
|
|
148
|
-
]
|
|
149
|
-
},
|
|
150
|
-
"product_added": {
|
|
151
|
-
"enrichments": [
|
|
152
|
-
{
|
|
153
|
-
"staticString": "add_to_cart",
|
|
154
|
-
"outputKey": "event"
|
|
155
|
-
}
|
|
156
|
-
],
|
|
157
|
-
"mappings": [
|
|
158
|
-
{
|
|
159
|
-
"inputKey": "properties.product_id",
|
|
160
|
-
"outputKey": "product_id"
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
"cart_viewed": {
|
|
165
|
-
"expressions": [
|
|
166
|
-
{
|
|
167
|
-
"lang": "lua",
|
|
168
|
-
"body": "local products = MAP(\n input.properties.products,\n function (p)\n return {\n sku = p.product_id,\n }\n end\n)\nreturn {\n event = 'checkout',\n total = SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end)),\n products = products,\n}"
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
},
|
|
172
|
-
"order_completed": {
|
|
173
|
-
"expressions": [
|
|
174
|
-
{
|
|
175
|
-
"lang": "lua",
|
|
176
|
-
"body": "local products = MAP(\n input.properties.products,\n function (p)\n return {\n sku = p.product_id,\n price = TO_FLOAT(p.price),\n quantity = TO_FLOAT(p.quantity) or 1,\n }\n end\n)\nreturn {\n event = 'purchase',\n order_id = input.properties.order_id,\n total = SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end)),\n revenue = TO_FLOAT(input.properties.revenue),\n shipping = TO_FLOAT(input.properties.shipping),\n tax = TO_FLOAT(input.properties.tax),\n discount = TO_FLOAT(input.properties.discount),\n coupon = input.properties.coupon,\n products = products,\n}"
|
|
177
|
-
}
|
|
178
|
-
]
|
|
179
|
-
}
|
|
180
|
-
}
|
|
2
|
+
"version": "v0.0.1"
|
|
181
3
|
}
|