@metarouter/ajs-starter-kit 1.0.27 → 1.0.32
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.
- package/.dist/actioniq/endpoint_schema.etag.json +1 -1
- package/.dist/actioniq/endpoint_schema.json +22 -6
- package/.dist/actioniq/kit.etag.json +1 -1
- package/.dist/actioniq/metadata.json +4 -0
- package/.dist/actioniq/playbook.etag.json +1 -1
- package/.dist/actioniq/playbook.json +13 -1
- package/.dist/acuity-ads/endpoint_schema.etag.json +1 -1
- package/.dist/acuity-ads/endpoint_schema.json +1 -2
- package/.dist/acuity-ads/kit.etag.json +1 -1
- package/.dist/adobe/endpoint_schema.etag.json +1 -1
- package/.dist/adobe/endpoint_schema.json +1 -2
- package/.dist/adobe/kit.etag.json +1 -1
- package/.dist/amnet/endpoint_schema.etag.json +1 -1
- package/.dist/amnet/endpoint_schema.json +1 -2
- package/.dist/amnet/kit.etag.json +1 -1
- package/.dist/amobee/endpoint_schema.etag.json +1 -1
- package/.dist/amobee/endpoint_schema.json +1 -2
- package/.dist/amobee/kit.etag.json +1 -1
- package/.dist/amplitude/endpoint_schema.etag.json +1 -1
- package/.dist/amplitude/endpoint_schema.json +1 -3
- package/.dist/amplitude/kit.etag.json +1 -1
- package/.dist/amplitude/metadata.json +4 -0
- package/.dist/amplitude/playbook.etag.json +1 -1
- package/.dist/amplitude/playbook.json +24 -25
- package/.dist/apps-flyer-android/endpoint_schema.etag.json +1 -1
- package/.dist/apps-flyer-android/endpoint_schema.json +0 -1
- package/.dist/apps-flyer-android/kit.etag.json +1 -1
- package/.dist/apps-flyer-ios/endpoint_schema.etag.json +1 -1
- package/.dist/apps-flyer-ios/endpoint_schema.json +0 -1
- package/.dist/apps-flyer-ios/kit.etag.json +1 -1
- package/.dist/bing-ads/endpoint_schema.etag.json +1 -1
- package/.dist/bing-ads/endpoint_schema.json +1 -2
- package/.dist/bing-ads/kit.etag.json +1 -1
- package/.dist/blueshift/endpoint_schema.etag.json +1 -1
- package/.dist/blueshift/endpoint_schema.json +1 -2
- package/.dist/blueshift/kit.etag.json +1 -1
- package/.dist/braze/endpoint_schema.etag.json +1 -1
- package/.dist/braze/endpoint_schema.json +2 -4
- package/.dist/braze/kit.etag.json +1 -1
- package/.dist/criteo/endpoint_schema.etag.json +1 -1
- package/.dist/criteo/endpoint_schema.json +1 -2
- package/.dist/criteo/kit.etag.json +1 -1
- package/.dist/facebook-pixel/endpoint_schema.etag.json +1 -1
- package/.dist/facebook-pixel/endpoint_schema.json +1 -2
- package/.dist/facebook-pixel/kit.etag.json +1 -1
- package/.dist/google-ad-words/endpoint_schema.etag.json +1 -1
- package/.dist/google-ad-words/endpoint_schema.json +1 -2
- package/.dist/google-ad-words/kit.etag.json +1 -1
- package/.dist/google-analytics/endpoint_schema.etag.json +1 -1
- package/.dist/google-analytics/endpoint_schema.json +1 -2
- package/.dist/google-analytics/kit.etag.json +1 -1
- package/.dist/google-double-click/endpoint_schema.etag.json +1 -1
- package/.dist/google-double-click/endpoint_schema.json +1 -2
- package/.dist/google-double-click/kit.etag.json +1 -1
- package/.dist/impact-radius/endpoint_schema.etag.json +1 -1
- package/.dist/impact-radius/endpoint_schema.json +2 -4
- package/.dist/impact-radius/kit.etag.json +1 -1
- package/.dist/in-market/endpoint_schema.etag.json +1 -1
- package/.dist/in-market/endpoint_schema.json +0 -1
- package/.dist/in-market/kit.etag.json +1 -1
- package/.dist/lytics/endpoint_schema.etag.json +1 -1
- package/.dist/lytics/endpoint_schema.json +1 -2
- package/.dist/lytics/kit.etag.json +1 -1
- package/.dist/media-math/endpoint_schema.etag.json +1 -1
- package/.dist/media-math/endpoint_schema.json +1 -2
- package/.dist/media-math/kit.etag.json +1 -1
- package/.dist/merkle/endpoint_schema.etag.json +1 -1
- package/.dist/merkle/endpoint_schema.json +1 -2
- package/.dist/merkle/kit.etag.json +1 -1
- package/.dist/movable-ink/endpoint_schema.etag.json +1 -1
- package/.dist/movable-ink/endpoint_schema.json +1 -2
- package/.dist/movable-ink/kit.etag.json +1 -1
- package/.dist/pinterest/endpoint_schema.etag.json +1 -1
- package/.dist/pinterest/endpoint_schema.json +1 -2
- package/.dist/pinterest/kit.etag.json +1 -1
- package/.dist/rev-jet/endpoint_schema.etag.json +1 -1
- package/.dist/rev-jet/endpoint_schema.json +1 -2
- package/.dist/rev-jet/kit.etag.json +1 -1
- package/.dist/roomvo/endpoint_schema.etag.json +1 -1
- package/.dist/roomvo/endpoint_schema.json +0 -1
- package/.dist/roomvo/kit.etag.json +1 -1
- package/.dist/snapchat/endpoint_schema.etag.json +1 -1
- package/.dist/snapchat/endpoint_schema.json +1 -2
- package/.dist/snapchat/kit.etag.json +1 -1
- package/.dist/snowflake/endpoint_schema.etag.json +1 -1
- package/.dist/snowflake/endpoint_schema.json +1 -2
- package/.dist/snowflake/kit.etag.json +1 -1
- package/.dist/verizon-media/endpoint_schema.etag.json +1 -1
- package/.dist/verizon-media/endpoint_schema.json +0 -1
- package/.dist/verizon-media/kit.etag.json +1 -1
- package/.dist/xandr/endpoint_schema.etag.json +1 -1
- package/.dist/xandr/endpoint_schema.json +1 -2
- package/.dist/xandr/kit.etag.json +1 -1
- package/index.js +40 -36
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"2afa3462fc26bac8ae25190b322764c5"
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
{
|
|
8
8
|
"name": "PASSWORD",
|
|
9
9
|
"exampleValue": "my-api-token"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "ENDPOINT_IDENTIFIER",
|
|
13
|
+
"exampleValue": "metarouter"
|
|
10
14
|
}
|
|
11
15
|
],
|
|
12
16
|
"default": {
|
|
@@ -14,19 +18,32 @@
|
|
|
14
18
|
"password": "$$PASSWORD$$",
|
|
15
19
|
"username": "$$USERNAME$$"
|
|
16
20
|
},
|
|
17
|
-
"endpoint": "https://push.actioniq.com/v1/streams
|
|
21
|
+
"endpoint": "https://push.actioniq.com/v1/streams/$$ENDPOINT_IDENTIFIER$$_track",
|
|
18
22
|
"headers": [
|
|
19
23
|
{
|
|
20
24
|
"key": "Content-Type",
|
|
21
25
|
"value": "application/json"
|
|
22
26
|
}
|
|
23
27
|
],
|
|
24
|
-
"method": "POST"
|
|
25
|
-
"timeout": "30s"
|
|
28
|
+
"method": "POST"
|
|
26
29
|
},
|
|
27
30
|
"eventSpecific": {
|
|
28
31
|
"identify": {
|
|
29
|
-
"endpoint": "https://push.actioniq.com/v1/streams
|
|
32
|
+
"endpoint": "https://push.actioniq.com/v1/streams/$$ENDPOINT_IDENTIFIER$$_identify",
|
|
33
|
+
"basicAuth": {
|
|
34
|
+
"password": "$$PASSWORD$$",
|
|
35
|
+
"username": "$$USERNAME$$"
|
|
36
|
+
},
|
|
37
|
+
"headers": [
|
|
38
|
+
{
|
|
39
|
+
"key": "Content-Type",
|
|
40
|
+
"value": "application/json"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"method": "POST"
|
|
44
|
+
},
|
|
45
|
+
"page": {
|
|
46
|
+
"endpoint": "https://push.actioniq.com/v1/streams/$$ENDPOINT_IDENTIFIER$$_page",
|
|
30
47
|
"basicAuth": {
|
|
31
48
|
"password": "$$PASSWORD$$",
|
|
32
49
|
"username": "$$USERNAME$$"
|
|
@@ -37,8 +54,7 @@
|
|
|
37
54
|
"value": "application/json"
|
|
38
55
|
}
|
|
39
56
|
],
|
|
40
|
-
"method": "POST"
|
|
41
|
-
"timeout": "30s"
|
|
57
|
+
"method": "POST"
|
|
42
58
|
}
|
|
43
59
|
}
|
|
44
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"60f7d97c416033cd8bffafb77774362a"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"2d91ab698f70628a0dd1315050a37f46"
|
|
@@ -43,6 +43,10 @@
|
|
|
43
43
|
"inputKey": "traits",
|
|
44
44
|
"outputKey": "properties.traits"
|
|
45
45
|
},
|
|
46
|
+
{
|
|
47
|
+
"inputKey": "context",
|
|
48
|
+
"outputKey": "properties.context"
|
|
49
|
+
},
|
|
46
50
|
{
|
|
47
51
|
"inputKey": "input",
|
|
48
52
|
"outputKey": "properties.isAnonymous",
|
|
@@ -67,6 +71,10 @@
|
|
|
67
71
|
"inputKey": "anonymousId",
|
|
68
72
|
"outputKey": "properties.anonymousId"
|
|
69
73
|
},
|
|
74
|
+
{
|
|
75
|
+
"inputKey": "context",
|
|
76
|
+
"outputKey": "properties.context"
|
|
77
|
+
},
|
|
70
78
|
{
|
|
71
79
|
"inputKey": "input",
|
|
72
80
|
"outputKey": "properties.isAnonymous",
|
|
@@ -84,6 +92,10 @@
|
|
|
84
92
|
},
|
|
85
93
|
"default": {
|
|
86
94
|
"mappings": [
|
|
95
|
+
{
|
|
96
|
+
"inputKey": "context",
|
|
97
|
+
"outputKey": "properties.context"
|
|
98
|
+
},
|
|
87
99
|
{
|
|
88
100
|
"inputKey": "anonymousId",
|
|
89
101
|
"outputKey": "properties.anonymousId"
|
|
@@ -116,7 +128,7 @@
|
|
|
116
128
|
"expressions": [
|
|
117
129
|
{
|
|
118
130
|
"lang": "lua",
|
|
119
|
-
"body": "local eventName = REPLACE(LOWER(input.event), \" \", \"_\")\nlocal results = {}\n\nlocal flatten = FLATTEN(input.properties, \"\", \"_\", 2
|
|
131
|
+
"body": "local eventName = REPLACE(LOWER(input.event), \" \", \"_\")\nlocal results = {}\n\nlocal flatten = FLATTEN(input.properties, \"\", \"_\", 2, { array_start_index = 1 })\nresults[eventName] = flatten\n\nreturn { properties = results }"
|
|
120
132
|
}
|
|
121
133
|
]
|
|
122
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"cd86cc049dbf57711f37abc7d3cb93e9"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"d48cb940c9b60d8515066e7d5baddc36"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"00a1119e77914ebb412cba0b4bda50ca"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"d0ef12bb0cc1957626398dd40527230c"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"fccf1b2a9e1768aeb123210f6d7b2ab7"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"0d48a69047ea95a58f95820fc5ce5897"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"5c8066cad53974a7f636dd7b164808fb"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"db6248bf3c372b4907ff008dcfcccd70"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"f061609cccf83f121fadc494db9acbb3"
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"default": {
|
|
3
3
|
"endpoint": "https://api2.amplitude.com/2/httpapi",
|
|
4
4
|
"method": "POST",
|
|
5
|
-
"timeout": "30s",
|
|
6
5
|
"headers": [
|
|
7
6
|
{
|
|
8
7
|
"key": "Content-Type",
|
|
@@ -17,8 +16,7 @@
|
|
|
17
16
|
"eventSpecific": {
|
|
18
17
|
"identify": {
|
|
19
18
|
"endpoint": "https://api.amplitude.com/identify",
|
|
20
|
-
"method": "GET"
|
|
21
|
-
"timeout": "30s"
|
|
19
|
+
"method": "GET"
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"1c87bdc5dacfed08e2e38a3f9b5bb470"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"7dc5d0857345917d8bb9939a899024b0"
|
|
@@ -7,23 +7,6 @@
|
|
|
7
7
|
}
|
|
8
8
|
],
|
|
9
9
|
"global": {
|
|
10
|
-
"filters": [
|
|
11
|
-
{
|
|
12
|
-
"byEventNames": {
|
|
13
|
-
"action": "allow",
|
|
14
|
-
"events": [
|
|
15
|
-
"identify",
|
|
16
|
-
"page",
|
|
17
|
-
"products_searched",
|
|
18
|
-
"product_list_viewed",
|
|
19
|
-
"product_viewed",
|
|
20
|
-
"product_added",
|
|
21
|
-
"cart_viewed",
|
|
22
|
-
"order_completed"
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
10
|
"enrichments": [
|
|
28
11
|
{
|
|
29
12
|
"staticString": "$$API_KEY$$",
|
|
@@ -41,7 +24,7 @@
|
|
|
41
24
|
{
|
|
42
25
|
"expression": {
|
|
43
26
|
"lang": "lua",
|
|
44
|
-
"body": "return {\n user_id = input.userId,\n device_id = input.anonymousId,\n user_properties =
|
|
27
|
+
"body": "function getPlatform (type)\n local t = LOWER(type) or ''\n if t == 'ios' then\n return 'iOS'\n elseif t == 'android' then\n return 'Android'\n else\n return 'Web'\n end\nend\n\nfunction urldecode(s)\n s = s:gsub('+', ' ')\n :gsub('%%(%x%x)', function(h)\n return string.char(tonumber(h, 16))\n end)\n return s\nend\n\nfunction parseurl(s)\n local ans = {}\n for k,v in s:gmatch('([^&=?]-)=([^&=?]+)' ) do\n ans[ k ] = urldecode(v)\n end\n return ans\nend\n\nlocal url = parseurl(input.context.page.url)\n\nlocal user_props = input.traits or {}\nuser_props['user_id'] = input.userId\nuser_props['device_id'] = input.anonymousId\nuser_props['message_id'] = input.messageId\nuser_props['referrer'] = input.context.page.referrer or \"\"\nuser_props['referring_domain'] = SPLIT(SPLIT(input.context.page.referrer, \"//\", 2)[2], \"/\", 2)[1] or \"\"\nuser_props['utm_source'] = input.context.campaign.source\nuser_props['utm_medium'] = input.context.campaign.medium\nuser_props['utm_campaign'] = input.context.campaign.name\nuser_props['utm_term'] = input.context.campaign.term\nuser_props['utm_content'] = input.context.campaign.content\nuser_props['gclid'] = url.gclid\nuser_props['dclid'] = url.dclid\nuser_props['fbclid'] = url.fbclid\n\nreturn {\n user_id = input.userId,\n device_id = input.anonymousId,\n user_properties = user_props,\n app_version = input.context.app.version,\n platform = getPlatform(input.context.device.type),\n os_name = input.context.os.name,\n os_version = input.context.os.version,\n device_manufacturer = input.context.device.manufacturer,\n device_model = input.context.device.model,\n carrier = input.context.network.carrier,\n ip = input.context.ip,\n user_agent = input.context.userAgent,\n}"
|
|
45
28
|
}
|
|
46
29
|
}
|
|
47
30
|
]
|
|
@@ -57,7 +40,7 @@
|
|
|
57
40
|
{
|
|
58
41
|
"expression": {
|
|
59
42
|
"lang": "lua",
|
|
60
|
-
"body": "return {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = 'Loaded a Page',\n event_properties = {\n category = input.properties.category,\n name = input.properties.name,\n },\n user_properties = {\n user_id = input.userId,\n device_id = input.anonymousId,\n }
|
|
43
|
+
"body": "function getPlatform (type)\n local t = LOWER(type) or ''\n if t == 'ios' then\n return 'iOS'\n elseif t == 'android' then\n return 'Android'\n else\n return 'Web'\n end\nend\n\nfunction urldecode(s)\n s = s:gsub('+', ' ')\n :gsub('%%(%x%x)', function(h)\n return string.char(tonumber(h, 16))\n end)\n return s\nend\n\nfunction parseurl(s)\n local ans = {}\n for k,v in s:gmatch('([^&=?]-)=([^&=?]+)' ) do\n ans[ k ] = urldecode(v)\n end\n return ans\nend\n\nlocal url = parseurl(input.context.page.url)\n\nreturn {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = 'Loaded a Page',\n event_properties = {\n category = input.properties.category,\n name = input.properties.name,\n },\n user_properties = {\n user_id = input.userId,\n device_id = input.anonymousId,\n referrer = input.context.page.referrer or \"\",\n referring_domain = SPLIT(SPLIT(input.context.page.referrer, \"//\", 2)[2], \"/\", 2)[1] or \"\",\n utm_source = input.context.campaign.source,\n utm_medium = input.context.campaign.medium,\n utm_campaign = input.context.campaign.name,\n utm_term = input.context.campaign.term,\n utm_content = input.context.campaign.content,\n gclid = url.gclid,\n dclid = url.dclid,\n fbclid = url.fbclid,\n },\n app_version = input.context.app.version,\n platform = getPlatform(input.context.device.type),\n os_name = input.context.os.name,\n os_version = input.context.os.version,\n device_manufacturer = input.context.device.manufacturer,\n device_model = input.context.device.model,\n carrier = input.context.network.carrier,\n ip = input.context.ip,\n user_agent = input.context.userAgent,\n}}"
|
|
61
44
|
}
|
|
62
45
|
}
|
|
63
46
|
]
|
|
@@ -73,7 +56,7 @@
|
|
|
73
56
|
{
|
|
74
57
|
"expression": {
|
|
75
58
|
"lang": "lua",
|
|
76
|
-
"body": "return {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = '
|
|
59
|
+
"body": "function getPlatform (type)\n local t = LOWER(type) or ''\n if t == 'ios' then\n return 'iOS'\n elseif t == 'android' then\n return 'Android'\n else\n return 'Web'\n end\nend\n\nfunction urldecode(s)\n s = s:gsub('+', ' ')\n :gsub('%%(%x%x)', function(h)\n return string.char(tonumber(h, 16))\n end)\n return s\nend\n\nfunction parseurl(s)\n local ans = {}\n for k,v in s:gmatch('([^&=?]-)=([^&=?]+)' ) do\n ans[ k ] = urldecode(v)\n end\n return ans\nend\n\nlocal url = parseurl(input.context.page.url)\n\nreturn {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = 'Search Completed',\n event_properties = {\n keywords= input.properties.query,\n },\n user_properties = {\n user_id = input.userId,\n device_id = input.anonymousId,\n referrer = input.context.page.referrer or \"\",\n referring_domain = SPLIT(SPLIT(input.context.page.referrer, \"//\", 2)[2], \"/\", 2)[1] or \"\",\n utm_source = input.context.campaign.source,\n utm_medium = input.context.campaign.medium,\n utm_campaign = input.context.campaign.name,\n utm_term = input.context.campaign.term,\n utm_content = input.context.campaign.content,\n gclid = url.gclid,\n dclid = url.dclid,\n fbclid = url.fbclid,\n },\n app_version = input.context.app.version,\n platform = getPlatform(input.context.device.type),\n os_name = input.context.os.name,\n os_version = input.context.os.version,\n device_manufacturer = input.context.device.manufacturer,\n device_model = input.context.device.model,\n carrier = input.context.network.carrier,\n ip = input.context.ip,\n user_agent = input.context.userAgent,\n}}"
|
|
77
60
|
}
|
|
78
61
|
}
|
|
79
62
|
]
|
|
@@ -89,7 +72,7 @@
|
|
|
89
72
|
{
|
|
90
73
|
"expression": {
|
|
91
74
|
"lang": "lua",
|
|
92
|
-
"body": "return {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = '
|
|
75
|
+
"body": "function getPlatform (type)\n local t = LOWER(type) or ''\n if t == 'ios' then\n return 'iOS'\n elseif t == 'android' then\n return 'Android'\n else\n return 'Web'\n end\nend\n\nfunction urldecode(s)\n s = s:gsub('+', ' ')\n :gsub('%%(%x%x)', function(h)\n return string.char(tonumber(h, 16))\n end)\n return s\nend\n\nfunction parseurl(s)\n local ans = {}\n for k,v in s:gmatch('([^&=?]-)=([^&=?]+)' ) do\n ans[ k ] = urldecode(v)\n end\n return ans\nend\n\nlocal url = parseurl(input.context.page.url)\n\nreturn {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = 'Product List Viewed',\n event_properties = {\n list_category = input.properties.category,\n list_id = input.properties.list_id,\n },\n user_properties = {\n user_id = input.userId,\n device_id = input.anonymousId,\n referrer = input.context.page.referrer or \"\",\n referring_domain = SPLIT(SPLIT(input.context.page.referrer, \"//\", 2)[2], \"/\", 2)[1] or \"\",\n utm_source = input.context.campaign.source,\n utm_medium = input.context.campaign.medium,\n utm_campaign = input.context.campaign.name,\n utm_term = input.context.campaign.term,\n utm_content = input.context.campaign.content,\n gclid = url.gclid,\n dclid = url.dclid,\n fbclid = url.fbclid,\n },\n app_version = input.context.app.version,\n platform = getPlatform(input.context.device.type),\n os_name = input.context.os.name,\n os_version = input.context.os.version,\n device_manufacturer = input.context.device.manufacturer,\n device_model = input.context.device.model,\n carrier = input.context.network.carrier,\n ip = input.context.ip,\n user_agent = input.context.userAgent,\n}}"
|
|
93
76
|
}
|
|
94
77
|
}
|
|
95
78
|
]
|
|
@@ -105,7 +88,7 @@
|
|
|
105
88
|
{
|
|
106
89
|
"expression": {
|
|
107
90
|
"lang": "lua",
|
|
108
|
-
"body": "return {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = '
|
|
91
|
+
"body": "function getPlatform (type)\n local t = LOWER(type) or ''\n if t == 'ios' then\n return 'iOS'\n elseif t == 'android' then\n return 'Android'\n else\n return 'Web'\n end\nend\n\nfunction urldecode(s)\n s = s:gsub('+', ' ')\n :gsub('%%(%x%x)', function(h)\n return string.char(tonumber(h, 16))\n end)\n return s\nend\n\nfunction parseurl(s)\n local ans = {}\n for k,v in s:gmatch('([^&=?]-)=([^&=?]+)' ) do\n ans[ k ] = urldecode(v)\n end\n return ans\nend\n\nlocal url = parseurl(input.context.page.url)\n\nreturn {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = 'Product Viewed',\n event_properties = {\n product_name = input.properties.name,\n product_sku = input.properties.sku,\n product_id = input.properties.product_id,\n product_category = input.properties.category,\n product_price = input.properties.price,\n },\n user_properties = {\n user_id = input.userId,\n device_id = input.anonymousId,\n referrer = input.context.page.referrer or \"\",\n referring_domain = SPLIT(SPLIT(input.context.page.referrer, \"//\", 2)[2], \"/\", 2)[1] or \"\",\n utm_source = input.context.campaign.source,\n utm_medium = input.context.campaign.medium,\n utm_campaign = input.context.campaign.name,\n utm_term = input.context.campaign.term,\n utm_content = input.context.campaign.content,\n gclid = url.gclid,\n dclid = url.dclid,\n fbclid = url.fbclid,\n },\n app_version = input.context.app.version,\n platform = getPlatform(input.context.device.type),\n os_name = input.context.os.name,\n os_version = input.context.os.version,\n device_manufacturer = input.context.device.manufacturer,\n device_model = input.context.device.model,\n carrier = input.context.network.carrier,\n ip = input.context.ip,\n user_agent = input.context.userAgent,\n}}"
|
|
109
92
|
}
|
|
110
93
|
}
|
|
111
94
|
]
|
|
@@ -121,7 +104,7 @@
|
|
|
121
104
|
{
|
|
122
105
|
"expression": {
|
|
123
106
|
"lang": "lua",
|
|
124
|
-
"body": "return {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = '
|
|
107
|
+
"body": "function getPlatform (type)\n local t = LOWER(type) or ''\n if t == 'ios' then\n return 'iOS'\n elseif t == 'android' then\n return 'Android'\n else\n return 'Web'\n end\nend\n\nfunction urldecode(s)\n s = s:gsub('+', ' ')\n :gsub('%%(%x%x)', function(h)\n return string.char(tonumber(h, 16))\n end)\n return s\nend\n\nfunction parseurl(s)\n local ans = {}\n for k,v in s:gmatch('([^&=?]-)=([^&=?]+)' ) do\n ans[ k ] = urldecode(v)\n end\n return ans\nend\n\nlocal url = parseurl(input.context.page.url)\n\nreturn {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = 'Product Added',\n event_properties = {\n product_name = input.properties.name,\n product_sku = input.properties.sku,\n product_id = input.properties.product_id,\n product_category = input.properties.category,\n product_price = input.properties.price,\n product_quantity = input.properties.quantity,\n },\n user_properties = {\n user_id = input.userId,\n device_id = input.anonymousId,\n referrer = input.context.page.referrer or \"\",\n referring_domain = SPLIT(SPLIT(input.context.page.referrer, \"//\", 2)[2], \"/\", 2)[1] or \"\",\n utm_source = input.context.campaign.source,\n utm_medium = input.context.campaign.medium,\n utm_campaign = input.context.campaign.name,\n utm_term = input.context.campaign.term,\n utm_content = input.context.campaign.content,\n gclid = url.gclid,\n dclid = url.dclid,\n fbclid = url.fbclid,\n },\n app_version = input.context.app.version,\n platform = getPlatform(input.context.device.type),\n os_name = input.context.os.name,\n os_version = input.context.os.version,\n device_manufacturer = input.context.device.manufacturer,\n device_model = input.context.device.model,\n carrier = input.context.network.carrier,\n ip = input.context.ip,\n user_agent = input.context.userAgent,\n}}"
|
|
125
108
|
}
|
|
126
109
|
}
|
|
127
110
|
]
|
|
@@ -137,7 +120,7 @@
|
|
|
137
120
|
{
|
|
138
121
|
"expression": {
|
|
139
122
|
"lang": "lua",
|
|
140
|
-
"body": "return {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = '
|
|
123
|
+
"body": "function getPlatform (type)\n local t = LOWER(type) or ''\n if t == 'ios' then\n return 'iOS'\n elseif t == 'android' then\n return 'Android'\n else\n return 'Web'\n end\nend\n\nfunction urldecode(s)\n s = s:gsub('+', ' ')\n :gsub('%%(%x%x)', function(h)\n return string.char(tonumber(h, 16))\n end)\n return s\nend\n\nfunction parseurl(s)\n local ans = {}\n for k,v in s:gmatch('([^&=?]-)=([^&=?]+)' ) do\n ans[ k ] = urldecode(v)\n end\n return ans\nend\n\nlocal url = parseurl(input.context.page.url)\n\nreturn {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = 'Cart Viewed',\n event_properties = {\n total_cart_size = #input.properties.products,\n total_cart_value = SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end)),\n cart_id = input.properties.cart_id,\n },\n user_properties = {\n user_id = input.userId,\n device_id = input.anonymousId,\n referrer = input.context.page.referrer or \"\",\n referring_domain = SPLIT(SPLIT(input.context.page.referrer, \"//\", 2)[2], \"/\", 2)[1] or \"\",\n utm_source = input.context.campaign.source,\n utm_medium = input.context.campaign.medium,\n utm_campaign = input.context.campaign.name,\n utm_term = input.context.campaign.term,\n utm_content = input.context.campaign.content,\n gclid = url.gclid,\n dclid = url.dclid,\n fbclid = url.fbclid,\n },\n app_version = input.context.app.version,\n platform = getPlatform(input.context.device.type),\n os_name = input.context.os.name,\n os_version = input.context.os.version,\n device_manufacturer = input.context.device.manufacturer,\n device_model = input.context.device.model,\n carrier = input.context.network.carrier,\n ip = input.context.ip,\n user_agent = input.context.userAgent,\n}}"
|
|
141
124
|
}
|
|
142
125
|
}
|
|
143
126
|
]
|
|
@@ -153,12 +136,28 @@
|
|
|
153
136
|
{
|
|
154
137
|
"expression": {
|
|
155
138
|
"lang": "lua",
|
|
156
|
-
"body": "local
|
|
139
|
+
"body": "function getPlatform (type)\n local t = LOWER(type) or ''\n if t == 'ios' then\n return 'iOS'\n elseif t == 'android' then\n return 'Android'\n else\n return 'Web'\n end\nend\n\nfunction urldecode(s)\n s = s:gsub('+', ' ')\n :gsub('%%(%x%x)', function(h)\n return string.char(tonumber(h, 16))\n end)\n return s\nend\n\nfunction parseurl(s)\n local ans = {}\n for k,v in s:gmatch('([^&=?]-)=([^&=?]+)' ) do\n ans[ k ] = urldecode(v)\n end\n return ans\nend\n\nlocal url = parseurl(input.context.page.url)\n\nlocal props = {\n cart_id = input.properties.cart_id,\n total_cart_size = #input.properties.products,\n total_cart_value = SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end)),\n promo_code_applied = input.properties.coupon,\n order_total = input.properties.total,\n total_discounts = input.properties.discount,\n order_id = input.properties.order_id,\n total_shipping = input.properties.shipping,\n total_tax = input.properties.tax,\n}\n\nprops['$revenue'] = TO_FLOAT(input.properties.revenue)\n\nreturn {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = 'Order Completed',\n event_properties = props,\n user_properties = {\n user_id = input.userId,\n device_id = input.anonymousId,\n referrer = input.context.page.referrer or \"\",\n referring_domain = SPLIT(SPLIT(input.context.page.referrer, \"//\", 2)[2], \"/\", 2)[1] or \"\",\n utm_source = input.context.campaign.source,\n utm_medium = input.context.campaign.medium,\n utm_campaign = input.context.campaign.name,\n utm_term = input.context.campaign.term,\n utm_content = input.context.campaign.content,\n gclid = url.gclid,\n dclid = url.dclid,\n fbclid = url.fbclid,\n },\n app_version = input.context.app.version,\n platform = getPlatform(input.context.device.type),\n os_name = input.context.os.name,\n os_version = input.context.os.version,\n device_manufacturer = input.context.device.manufacturer,\n device_model = input.context.device.model,\n carrier = input.context.network.carrier,\n ip = input.context.ip,\n user_agent = input.context.userAgent,\n}}"
|
|
157
140
|
}
|
|
158
141
|
}
|
|
159
142
|
]
|
|
160
143
|
}
|
|
161
144
|
]
|
|
162
145
|
}
|
|
146
|
+
},
|
|
147
|
+
"default": {
|
|
148
|
+
"mappings": [
|
|
149
|
+
{
|
|
150
|
+
"inputKey": "input",
|
|
151
|
+
"outputKey": "events",
|
|
152
|
+
"transforms": [
|
|
153
|
+
{
|
|
154
|
+
"expression": {
|
|
155
|
+
"lang": "lua",
|
|
156
|
+
"body": "function getPlatform (type)\n local t = LOWER(type) or ''\n if t == 'ios' then\n return 'iOS'\n elseif t == 'android' then\n return 'Android'\n else\n return 'Web'\n end\nend\n\nfunction urldecode(s)\n s = s:gsub('+', ' ')\n :gsub('%%(%x%x)', function(h)\n return string.char(tonumber(h, 16))\n end)\n return s\nend\n\nfunction parseurl(s)\n local ans = {}\n for k,v in s:gmatch('([^&=?]-)=([^&=?]+)' ) do\n ans[ k ] = urldecode(v)\n end\n return ans\nend\n\nlocal url = parseurl(input.context.page.url)\n\nlocal props = input.properties or {}\n\nreturn {{\n user_id = input.userId,\n device_id = input.anonymousId,\n insert_id = input.messageId,\n event_type = input.event,\n event_properties = props,\n user_properties = {\n user_id = input.userId,\n device_id = input.anonymousId,\n referrer = input.context.page.referrer or \"\",\n referring_domain = SPLIT(SPLIT(input.context.page.referrer, \"//\", 2)[2], \"/\", 2)[1] or \"\",\n utm_source = input.context.campaign.source,\n utm_medium = input.context.campaign.medium,\n utm_campaign = input.context.campaign.name,\n utm_term = input.context.campaign.term,\n utm_content = input.context.campaign.content,\n gclid = url.gclid,\n dclid = url.dclid,\n fbclid = url.fbclid,\n },\n app_version = input.context.app.version,\n platform = getPlatform(input.context.device.type),\n os_name = input.context.os.name,\n os_version = input.context.os.version,\n device_manufacturer = input.context.device.manufacturer,\n device_model = input.context.device.model,\n carrier = input.context.network.carrier,\n ip = input.context.ip,\n user_agent = input.context.userAgent,\n}}"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
]
|
|
163
162
|
}
|
|
164
163
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"f394685bc814f0e316a88b78ac13996a"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"368edd84ddc9b3f15ff81d2e6243a76e"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"bb350063b312a9a7be3ff17c148a38b8"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"86dfbf689a137a56f818a62211686a2d"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"0d9fac87fe41d46e4380040b60eb3f8c"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"66d57d208dcb111deda5a64486804c13"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"81a92754210def5df23cdc2022db40ce"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"52ba7ee5e1ce82db06a5c7f1808e6247"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"281e3836a204aa09c35f8ef973b9f394"
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
"value": "Bearer $$API_KEY$$"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"method": "POST"
|
|
25
|
-
"timeout": "30s"
|
|
24
|
+
"method": "POST"
|
|
26
25
|
},
|
|
27
26
|
"eventSpecific": {
|
|
28
27
|
"identify": {
|
|
@@ -37,8 +36,7 @@
|
|
|
37
36
|
"value": "Bearer $$API_KEY$$"
|
|
38
37
|
}
|
|
39
38
|
],
|
|
40
|
-
"method": "POST"
|
|
41
|
-
"timeout": "30s"
|
|
39
|
+
"method": "POST"
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"75d4717b552496800cd6dbd2dbeceb26"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"0c471d1504392504e2bfca3a657124c9"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"4d4d2a5e779487bcbbeda31115889d78"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"faafbcea9f2f14ddc0b58172b0f1164f"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"03bde8abbcde1e6741051053217526ca"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"6b43ed086a94df1146973713df5a9313"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"fe4df70b5b9331db7009d96e3ab8a66d"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"fe661136b97429236cab9617b39b1930"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"8df13fb27e6e880029db92afec41b893"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"d57939f1af32b8bab3de9a469358e7c0"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"f0813b1d73fd39d33ad4d269b9687dcf"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"14e009ff28748036c7de3c157646d964"
|
|
@@ -25,8 +25,7 @@
|
|
|
25
25
|
"value": "application/json"
|
|
26
26
|
}
|
|
27
27
|
],
|
|
28
|
-
"method": "POST"
|
|
29
|
-
"timeout": "30s"
|
|
28
|
+
"method": "POST"
|
|
30
29
|
},
|
|
31
30
|
"eventSpecific": {
|
|
32
31
|
"page": {
|
|
@@ -45,8 +44,7 @@
|
|
|
45
44
|
"value": "application/json"
|
|
46
45
|
}
|
|
47
46
|
],
|
|
48
|
-
"method": "POST"
|
|
49
|
-
"timeout": "30s"
|
|
47
|
+
"method": "POST"
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"20e35ac5e5c6aeb14cb1cf93618d3d43"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
"d23fa41aaa44fc3eefeecd7dcbfa305e"
|