@segment/action-destinations 3.49.2-alpha.2 → 3.50.1

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.
Files changed (97) hide show
  1. package/dist/destinations/amplitude/mapUser/index.js +1 -1
  2. package/dist/destinations/amplitude/mapUser/index.js.map +1 -1
  3. package/dist/destinations/gainsight-px-cloud-action/common-fields.js +5 -267
  4. package/dist/destinations/gainsight-px-cloud-action/common-fields.js.map +1 -1
  5. package/dist/destinations/gainsight-px-cloud-action/groupIdentify/generated-types.d.ts +0 -58
  6. package/dist/destinations/gainsight-px-cloud-action/groupIdentify/index.js +1 -22
  7. package/dist/destinations/gainsight-px-cloud-action/groupIdentify/index.js.map +1 -1
  8. package/dist/destinations/gainsight-px-cloud-action/identifyUser/generated-types.d.ts +0 -57
  9. package/dist/destinations/gainsight-px-cloud-action/identifyUser/index.js +1 -13
  10. package/dist/destinations/gainsight-px-cloud-action/identifyUser/index.js.map +1 -1
  11. package/dist/destinations/gainsight-px-cloud-action/index.js +5 -1
  12. package/dist/destinations/gainsight-px-cloud-action/index.js.map +1 -1
  13. package/dist/destinations/gainsight-px-cloud-action/regional-endpoints.d.ts +2 -0
  14. package/dist/destinations/gainsight-px-cloud-action/regional-endpoints.js +4 -2
  15. package/dist/destinations/gainsight-px-cloud-action/regional-endpoints.js.map +1 -1
  16. package/dist/destinations/gainsight-px-cloud-action/trackEvent/generated-types.d.ts +0 -58
  17. package/dist/destinations/gainsight-px-cloud-action/trackEvent/index.js +1 -21
  18. package/dist/destinations/gainsight-px-cloud-action/trackEvent/index.js.map +1 -1
  19. package/dist/destinations/gainsight-px-cloud-action/trackPageView/generated-types.d.ts +0 -61
  20. package/dist/destinations/gainsight-px-cloud-action/trackPageView/index.js +1 -44
  21. package/dist/destinations/gainsight-px-cloud-action/trackPageView/index.js.map +1 -1
  22. package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +4 -0
  23. package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +6 -2
  24. package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
  25. package/dist/destinations/google-analytics-4/addToCart/generated-types.d.ts +4 -0
  26. package/dist/destinations/google-analytics-4/addToCart/index.js +6 -2
  27. package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
  28. package/dist/destinations/google-analytics-4/addToWishlist/generated-types.d.ts +4 -0
  29. package/dist/destinations/google-analytics-4/addToWishlist/index.js +6 -2
  30. package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
  31. package/dist/destinations/google-analytics-4/beginCheckout/generated-types.d.ts +4 -0
  32. package/dist/destinations/google-analytics-4/beginCheckout/index.js +6 -2
  33. package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
  34. package/dist/destinations/google-analytics-4/customEvent/generated-types.d.ts +1 -0
  35. package/dist/destinations/google-analytics-4/customEvent/index.js +3 -7
  36. package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
  37. package/dist/destinations/google-analytics-4/ga4-properties.d.ts +2 -0
  38. package/dist/destinations/google-analytics-4/ga4-properties.js +12 -1
  39. package/dist/destinations/google-analytics-4/ga4-properties.js.map +1 -1
  40. package/dist/destinations/google-analytics-4/generateLead/generated-types.d.ts +4 -0
  41. package/dist/destinations/google-analytics-4/generateLead/index.js +6 -2
  42. package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
  43. package/dist/destinations/google-analytics-4/login/generated-types.d.ts +4 -0
  44. package/dist/destinations/google-analytics-4/login/index.js +6 -2
  45. package/dist/destinations/google-analytics-4/login/index.js.map +1 -1
  46. package/dist/destinations/google-analytics-4/pageView/generated-types.d.ts +4 -0
  47. package/dist/destinations/google-analytics-4/pageView/index.js +6 -2
  48. package/dist/destinations/google-analytics-4/pageView/index.js.map +1 -1
  49. package/dist/destinations/google-analytics-4/purchase/generated-types.d.ts +4 -0
  50. package/dist/destinations/google-analytics-4/purchase/index.js +6 -2
  51. package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
  52. package/dist/destinations/google-analytics-4/refund/generated-types.d.ts +4 -0
  53. package/dist/destinations/google-analytics-4/refund/index.js +6 -2
  54. package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
  55. package/dist/destinations/google-analytics-4/removeFromCart/generated-types.d.ts +4 -0
  56. package/dist/destinations/google-analytics-4/removeFromCart/index.js +6 -2
  57. package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
  58. package/dist/destinations/google-analytics-4/search/generated-types.d.ts +4 -0
  59. package/dist/destinations/google-analytics-4/search/index.js +6 -2
  60. package/dist/destinations/google-analytics-4/search/index.js.map +1 -1
  61. package/dist/destinations/google-analytics-4/selectItem/generated-types.d.ts +4 -0
  62. package/dist/destinations/google-analytics-4/selectItem/index.js +6 -2
  63. package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
  64. package/dist/destinations/google-analytics-4/selectPromotion/generated-types.d.ts +4 -0
  65. package/dist/destinations/google-analytics-4/selectPromotion/index.js +6 -2
  66. package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
  67. package/dist/destinations/google-analytics-4/signUp/generated-types.d.ts +4 -0
  68. package/dist/destinations/google-analytics-4/signUp/index.js +6 -2
  69. package/dist/destinations/google-analytics-4/signUp/index.js.map +1 -1
  70. package/dist/destinations/google-analytics-4/viewCart/generated-types.d.ts +4 -0
  71. package/dist/destinations/google-analytics-4/viewCart/index.js +6 -2
  72. package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
  73. package/dist/destinations/google-analytics-4/viewItem/generated-types.d.ts +4 -0
  74. package/dist/destinations/google-analytics-4/viewItem/index.js +6 -2
  75. package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
  76. package/dist/destinations/google-analytics-4/viewItemList/generated-types.d.ts +4 -0
  77. package/dist/destinations/google-analytics-4/viewItemList/index.js +6 -2
  78. package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
  79. package/dist/destinations/google-analytics-4/viewPromotion/generated-types.d.ts +4 -0
  80. package/dist/destinations/google-analytics-4/viewPromotion/index.js +6 -2
  81. package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
  82. package/dist/destinations/google-enhanced-conversions/postConversion/generated-types.d.ts +1 -0
  83. package/dist/destinations/google-enhanced-conversions/postConversion/index.js +8 -1
  84. package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
  85. package/dist/destinations/metronome/index.js +1 -1
  86. package/dist/destinations/metronome/index.js.map +1 -1
  87. package/dist/destinations/metronome/sendEvent/index.js +5 -7
  88. package/dist/destinations/metronome/sendEvent/index.js.map +1 -1
  89. package/dist/destinations/tiktok-conversions/index.js +14 -32
  90. package/dist/destinations/tiktok-conversions/index.js.map +1 -1
  91. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +3 -3
  92. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +3 -9
  93. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -1
  94. package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +6 -16
  95. package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +27 -177
  96. package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
  97. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItemList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;AACjD,sDAAmE;AASnE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,2DAA2D;IACxE,mBAAmB,EAAE,kDAAkD;IACvE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iEAAiE;YAC9E,OAAO,EAAE;gBACP,OAAO,EAAE,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IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItemList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;AACjD,sDAAoF;AASpF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,2DAA2D;IACxE,mBAAmB,EAAE,kDAAkD;IACvE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iEAAiE;YAC9E,OAAO,EAAE;gBACP,OAAO,EAAE,sBAAsB;aAChC;SACF;QACD,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mEAAmE;YAChF,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,KAAK,EAAE;YACL,GAAG,qCAAoB;YACvB,QAAQ,EAAE,IAAI;SACf;QACD,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,IAAI,WAAW,GAAkB,EAAE,CAAA;QAEnC,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC1C,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;oBACpE,MAAM,IAAI,+BAAgB,CACxB,+EAA+E,EAC/E,8BAA8B,EAC9B,GAAG,CACJ,CAAA;iBACF;gBAED,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,8BAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;oBACtE,MAAM,IAAI,+BAAgB,CAAC,GAAG,OAAO,CAAC,QAAQ,gCAAgC,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;iBAC/G;gBAED,OAAO,OAAsB,CAAA;YAC/B,CAAC,CAAC,CAAA;SACH;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,gBAAgB;wBACtB,MAAM,EAAE;4BACN,YAAY,EAAE,OAAO,CAAC,YAAY;4BAClC,cAAc,EAAE,OAAO,CAAC,cAAc;4BACtC,KAAK,EAAE,WAAW;4BAClB,GAAG,OAAO,CAAC,MAAM;yBAClB;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,5 +1,6 @@
1
1
  export interface Payload {
2
2
  client_id: string;
3
+ user_id?: string;
3
4
  creative_name?: string;
4
5
  creative_slot?: string;
5
6
  location_id?: string;
@@ -30,4 +31,7 @@ export interface Payload {
30
31
  promotion_name?: string;
31
32
  promotion_id?: string;
32
33
  }[];
34
+ params?: {
35
+ [k: string]: unknown;
36
+ };
33
37
  }
@@ -9,6 +9,7 @@ const action = {
9
9
  defaultSubscription: 'type = "track" and event = "Promotion Viewed"',
10
10
  fields: {
11
11
  client_id: { ...ga4_properties_1.client_id },
12
+ user_id: { ...ga4_properties_1.user_id },
12
13
  creative_name: { ...ga4_properties_1.creative_name },
13
14
  creative_slot: { ...ga4_properties_1.creative_slot, default: { '@path': '$.properties.creative' } },
14
15
  location_id: {
@@ -39,7 +40,8 @@ const action = {
39
40
  ...ga4_properties_1.promotion_id
40
41
  }
41
42
  }
42
- }
43
+ },
44
+ params: ga4_properties_1.params
43
45
  },
44
46
  perform: (request, { payload }) => {
45
47
  let googleItems = [];
@@ -58,6 +60,7 @@ const action = {
58
60
  method: 'POST',
59
61
  json: {
60
62
  client_id: payload.client_id,
63
+ user_id: payload.user_id,
61
64
  events: [
62
65
  {
63
66
  name: 'view_promotion',
@@ -67,7 +70,8 @@ const action = {
67
70
  location_id: payload.location_id,
68
71
  promotion_id: payload.promotion_id,
69
72
  promotion_name: payload.promotion_name,
70
- items: googleItems
73
+ items: googleItems,
74
+ ...payload.params
71
75
  }
72
76
  }
73
77
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;AACjD,sDAQ0B;AAS1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,gDAAgD;IAC7D,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE;QACnC,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,EAAE;QAClF,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yBAAyB;YACtC,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,YAAY,EAAE,EAAE,GAAG,6BAAY,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE,EAAE;QACpF,cAAc,EAAE,EAAE,GAAG,+BAAc,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE;QAChF,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,G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c,EAAE,OAAO,CAAC,cAAc;4BACtC,KAAK,EAAE,WAAW;yBACnB;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAiD;AACjD,sDAU0B;AAS1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,gDAAgD;IAC7D,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE;QACnC,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,EAAE;QAClF,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yBAAyB;YACtC,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,YAAY,EAAE,EAAE,GAAG,6BAAY,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE,EAAE;QACpF,cAAc,EAAE,EAAE,GAAG,+BAAc,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE;QAChF,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,GAAG,8BAAa,CAAC,UAAU;gBAC3B,aAAa,EAAE;oBACb,GAAG,8BAAa;iBACjB;gBACD,aAAa,EAAE;oBACb,GAAG,8BAAa;iBACjB;gBACD,cAAc,EAAE;oBACd,GAAG,+BAAc;iBAClB;gBACD,YAAY,EAAE;oBACZ,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IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -6,6 +6,7 @@ export interface Payload {
6
6
  conversion_time: string | number;
7
7
  value?: number;
8
8
  currency_code?: string;
9
+ is_app_incrementality?: boolean;
9
10
  phone_number?: string;
10
11
  first_name?: string;
11
12
  last_name?: string;
@@ -69,6 +69,12 @@ const action = {
69
69
  '@path': '$.properties.currency'
70
70
  }
71
71
  },
72
+ is_app_incrementality: {
73
+ label: 'App Conversion for Incrementality Study',
74
+ description: 'Set to true if this is an app conversion for an incrementality study.',
75
+ type: 'boolean',
76
+ default: false
77
+ },
72
78
  phone_number: {
73
79
  label: 'Phone Number',
74
80
  description: 'Phone number of the individual who triggered the conversion event, in E.164 standard format, e.g. +14150000000.',
@@ -173,7 +179,8 @@ const action = {
173
179
  conversion_time: +new Date(payload.conversion_time) * 1000,
174
180
  label: payload.conversion_label,
175
181
  value: payload.value,
176
- currency_code: payload.currency_code
182
+ currency_code: payload.currency_code,
183
+ is_app_incrementality: payload.is_app_incrementality ? 1 : 0
177
184
  });
178
185
  const address = formatter_1.cleanData({
179
186
  hashed_first_name: formatter_1.formatFirstName(payload.first_name),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/postConversion/index.ts"],"names":[],"mappings":";;AAAA,wDAAqF;AAIrF,2CASoB;AAYpB,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,wCAAwC;IACrD,MAAM,EAAE;QAEN,gBAAgB,EAAE;YAChB,KAAK,EAAE,kBAAkB;YACzB,WAAW,EACT,yMAAyM;YAC3M,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;SACZ;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,qEAAqE;YAClF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,MAAM,EAA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AA;gBACtC,IAAI,UAAU,KAAK,GAAG,EAAE;oBACtB,MAAM,IAAI,GAAI,GAAG,CAAC,QAA6B,CAAC,IAAmB,CAAA;oBACnE,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,KAAK,qBAAqB,CAAC,CAAA;oBAC9F,IAAI,YAAY,EAAE;wBAChB,MAAM,IAAI,+BAAgB,CAAC,wCAAwC,EAAE,qBAAqB,EAAE,GAAG,CAAC,CAAA;qBACjG;iBACF;aACF;YAED,MAAM,GAAG,CAAA;SACV;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/postConversion/index.ts"],"names":[],"mappings":";;AAAA,wDAAqF;AAIrF,2CASoB;AAYpB,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,wCAAwC;IACrD,MAAM,EAAE;QAEN,gBAAgB,EAAE;YAChB,KAAK,EAAE,kBAAkB;YACzB,WAAW,EACT,yMAAyM;YAC3M,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;SACZ;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,qEAAqE;YAClF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,OAAO;YACf,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;iBACpC;aACF;SACF;QACD,cAAc,EAAE;YACd,KAAK,EAAE,UAAU;YACjB,WAAW,EACT,gSAAgS;YAClS,IAAI,EA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CAAC,IAAmB,CAAA;oBACnE,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,KAAK,qBAAqB,CAAC,CAAA;oBAC9F,IAAI,YAAY,EAAE;wBAChB,MAAM,IAAI,+BAAgB,CAAC,wCAAwC,EAAE,qBAAqB,EAAE,GAAG,CAAC,CAAA;qBACjG;iBACF;aACF;YAED,MAAM,GAAG,CAAA;SACV;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -20,7 +20,7 @@ const destination = {
20
20
  }
21
21
  },
22
22
  testAuthentication: async (request) => {
23
- const response = await request('https://api.getmetronome.com/v1/ingest', {
23
+ const response = await request('https://api.metronome.com/v1/ingest', {
24
24
  method: 'post',
25
25
  json: [],
26
26
  throwHttpErrors: false
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/metronome/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAG5E,4DAAmC;AAEnC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,mBAAmB;IAEzB,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,0BAA0B;gBACvC,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,wCAAwC,EAAE;gBACvE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,EAAE;gBACR,eAAe,EAAE,KAAK;aACvB,CAAC,CAAA;YAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;gBAC3B,OAAO,IAAI,CAAA;a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KACF;IACD,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,QAAQ,CAAC,QAAQ,EAAE,EAAE;SAC1D,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;KACV;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,gCAAgC;YACtC,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,WAAW;YAC1B,OAAO,EAAE,4BAAa,CAAC,mBAAS,CAAC,MAAM,CAAC;SACzC;KACF;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -7,7 +7,7 @@ const dayjs_1 = __importDefault(require("../../../lib/dayjs"));
7
7
  function serializeEvent(event) {
8
8
  return {
9
9
  ...event,
10
- timestamp: dayjs_1.default.utc(event.timestamp).toISOString(),
10
+ timestamp: dayjs_1.default.utc(event.timestamp).toISOString()
11
11
  };
12
12
  }
13
13
  const action = {
@@ -58,16 +58,14 @@ const action = {
58
58
  default: {
59
59
  '@path': '$.properties'
60
60
  }
61
- },
61
+ }
62
62
  },
63
63
  perform: (request, { payload }) => {
64
- return request('https://api.getmetronome.com/v1/ingest', {
64
+ return request('https://api.metronome.com/v1/ingest', {
65
65
  method: 'post',
66
- json: [
67
- serializeEvent(payload)
68
- ]
66
+ json: [serializeEvent(payload)]
69
67
  });
70
- },
68
+ }
71
69
  };
72
70
  exports.default = action;
73
71
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/metronome/sendEvent/index.ts"],"names":[],"mappings":";;;;;AAGA,+DAAsC;AAEtC,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO;QACL,GAAG,KAAK;QAWR,SAAS,EAAE,eAAK,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;KACpD,CAAA;AACH,CAAC;AAED,MAA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QAEhC,OAAO,OAAO,CAAC,qCAAqC,EAAE;YACpD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;SAChC,CAAC,CAAA;IACJ,CAAC;CAOF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -7,48 +7,30 @@ const actions_core_1 = require("@segment/actions-core");
7
7
  const reportWebEvent_1 = __importDefault(require("./reportWebEvent"));
8
8
  const presets = [
9
9
  {
10
- name: 'View Content',
11
- subscribe: 'type="page"',
12
- partnerAction: 'reportWebEvent',
13
- mapping: {
14
- ...actions_core_1.defaultValues(reportWebEvent_1.default.fields),
15
- event: 'ViewContent'
16
- }
17
- },
18
- {
19
- name: 'Search',
20
- subscribe: 'event = "Products Searched"',
21
- partnerAction: 'reportWebEvent',
22
- mapping: {
23
- ...actions_core_1.defaultValues(reportWebEvent_1.default.fields),
24
- event: 'Search'
25
- }
26
- },
27
- {
28
- name: 'Add to Wishlist',
29
- subscribe: 'event = "Product Added to Wishlist"',
10
+ name: 'Initiate Checkout',
11
+ subscribe: 'event = "Checkout Started"',
30
12
  partnerAction: 'reportWebEvent',
31
13
  mapping: {
32
14
  ...actions_core_1.defaultValues(reportWebEvent_1.default.fields),
33
- event: 'AddToWishlist'
15
+ event: 'IntiateCheckout'
34
16
  }
35
17
  },
36
18
  {
37
- name: 'Add to Cart',
38
- subscribe: 'event = "Product Added"',
19
+ name: 'View Content',
20
+ subscribe: 'type="page"',
39
21
  partnerAction: 'reportWebEvent',
40
22
  mapping: {
41
23
  ...actions_core_1.defaultValues(reportWebEvent_1.default.fields),
42
- event: 'AddToCart'
24
+ event: 'ViewContent'
43
25
  }
44
26
  },
45
27
  {
46
- name: 'Initiate Checkout',
47
- subscribe: 'event = "Checkout Started"',
28
+ name: 'Products Searched',
29
+ subscribe: 'event = "Products Searched"',
48
30
  partnerAction: 'reportWebEvent',
49
31
  mapping: {
50
32
  ...actions_core_1.defaultValues(reportWebEvent_1.default.fields),
51
- event: 'InitiateCheckout'
33
+ event: 'Search'
52
34
  }
53
35
  },
54
36
  {
@@ -61,12 +43,12 @@ const presets = [
61
43
  }
62
44
  },
63
45
  {
64
- name: 'Place an Order',
46
+ name: 'Order Completed',
65
47
  subscribe: 'event = "Order Completed"',
66
48
  partnerAction: 'reportWebEvent',
67
49
  mapping: {
68
50
  ...actions_core_1.defaultValues(reportWebEvent_1.default.fields),
69
- event: 'PlaceAnOrder'
51
+ event: 'PlaceOrder'
70
52
  }
71
53
  }
72
54
  ];
@@ -79,14 +61,14 @@ const destination = {
79
61
  fields: {
80
62
  accessToken: {
81
63
  label: 'Access Token',
82
- description: 'Your TikTok Access Token. Please see TikToks [Events API documentation](https://ads.tiktok.com/marketing_api/docs?id=1701890979375106) for information on how to generate an access token via the TikTok Ads Manager or API.',
64
+ description: "TikTok Long Term Access Token. You can generate this from the TikTok Marketing API portal. Please follow TikTok's [Authorization guide](https://ads.tiktok.com/athena/docs/index.html?plat_id=-1&doc_id=100010&id=100681&key=e98b971a296ae45d8e35a22fba032d1c06f5973de9aab73ce07b82f230cf3afd) for more info.",
83
65
  type: 'string',
84
66
  required: true
85
67
  },
86
68
  pixel_code: {
87
69
  label: 'Pixel Code',
88
70
  type: 'string',
89
- description: 'Your TikTok Pixel ID. Please see TikTok’s [Events API documentation](https://ads.tiktok.com/marketing_api/docs?id=1701890979375106) for information on how to find this value.',
71
+ description: 'An ID for your pixel. Required to send events to the TikTok pixel.',
90
72
  required: true
91
73
  }
92
74
  },
@@ -95,7 +77,7 @@ const destination = {
95
77
  method: 'post',
96
78
  json: {
97
79
  pixel_code: settings.pixel_code,
98
- event: 'Test Event',
80
+ event: "Test Event",
99
81
  timestamp: '',
100
82
  context: {}
101
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-conversions/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AAGrD,sEAA6C;AAG7C,MAAM,OAAO,GAAqC;IACh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Aa,CAAC,wBAAc,CAAC,MAAM,CAAC;YACvC,KAAK,EAAE,cAAc;SACtB;KACF;CACF,CAAA;AAED,MAAM,WAAW,GAAoC;IAInD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,WAAW,EAAE;gBACX,KAAK,EAAE,cAAc;gBACrB,WAAW,EACT,+NAA+N;gBACjO,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,YAAY;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,gLAAgL;gBAClL,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAG5C,OAAO,OAAO,CAAC,4DAA4D,EAAE;gBAC3E,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE;oBACJ,UAAU,EAAE,QAAQ,CAAC,UAAU;oBAC/B,KAAK,EAAE,YAAY;oBACnB,SAAS,EAAE,EAAE;oBACb,OAAO,EAAE,EAAE;iBACZ;aACF,CAAC,CAAA;QACJ,CAAC;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE,EAAE,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE;SAClD,CAAA;IACH,CAAC;IACD,OAAO;IACP,OAAO,EAAE;QACP,cAAc,EAAd,wBAAc;KACf;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-conversions/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AAGrD,sEAA6C;AAG7C,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,mBAAmB;QACzB,SAAS,EAAE,4BAA4B;QACvC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QAAQ;gBACd,WAAW,EAAE,oEAAoE;gBACjF,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAG5C,OAAO,OAAO,CAAC,4DAA4D,EAAE;gBAC3E,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE;oBACJ,UAAU,EAAE,QAAQ,CAAC,UAAU;oBAC/B,KAAK,EAAE,YAAY;oBACnB,SAAS,EAAE,EAAE;oBACb,OAAO,EAAE,EAAE;iBACZ;aACF,CAAC,CAAA;QACJ,CAAC;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE,EAAE,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE;SAClD,CAAA;IACH,CAAC;IACD,OAAO;IACP,OAAO,EAAE;QACP,cAAc,EAAd,wBAAc;KACf;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -1,3 +1,3 @@
1
- export declare function formatEmail(email: string | undefined): string | undefined;
2
- export declare function formatUserId(userId: string | undefined): string | undefined;
3
- export declare function formatPhone(phone: string | undefined): string | undefined;
1
+ export declare function formatEmail(email: string): string;
2
+ export declare function formatUserId(userId: string): string;
3
+ export declare function formatPhone(phone?: string): string;
@@ -3,22 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatPhone = exports.formatUserId = exports.formatEmail = void 0;
4
4
  const crypto_1 = require("crypto");
5
5
  function formatEmail(email) {
6
- if (email) {
7
- return hashAndEncode(email.toLowerCase());
8
- }
9
- return undefined;
6
+ return hashAndEncode(email.toLowerCase());
10
7
  }
11
8
  exports.formatEmail = formatEmail;
12
9
  function formatUserId(userId) {
13
- if (userId) {
14
- return hashAndEncode(userId.toLowerCase().trim());
15
- }
16
- return undefined;
10
+ return hashAndEncode(userId.toLowerCase().trim());
17
11
  }
18
12
  exports.formatUserId = formatUserId;
19
13
  function formatPhone(phone) {
20
14
  if (!phone)
21
- return undefined;
15
+ return '';
22
16
  const validatedPhone = phone.match(/[0-9]{0,14}/g);
23
17
  if (validatedPhone === null) {
24
18
  throw new Error(`${phone} is not a valid E.164 phone number.`);
@@ -1 +1 @@
1
- {"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-conversions/reportWebEvent/formatter.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAKnC,SAAgB,WAAW,CAAC,KAAyB;IACnD,IAAI,KAAK,EAAE;QACT,OAAO,aAAa,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;KAC1C;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AALD,kCAKC;AAOD,SAAgB,YAAY,CAAC,MAA0B;IACrD,IAAI,MAAM,EAAE;QACV,OAAO,aAAa,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;KAClD;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AALD,oCAKC;AAOD,SAAgB,WAAW,CAAC,KAAyB;IACnD,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAE5B,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;IAClD,IAAI,cAAc,KAAK,IAAI,EAAE;QAC3B,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,qCAAqC,CAAC,CAAA;KAC/D;IAED,IAAI,cAAc,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAA;IAEvD,cAAc,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAChD,OAAO,aAAa,CAAC,cAAc,CAAC,CAAA;AACtC,CAAC;AAZD,kCAYC;AAED,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,mBAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC5D,CAAC"}
1
+ {"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-conversions/reportWebEvent/formatter.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAKnC,SAAgB,WAAW,CAAC,KAAa;IACvC,OAAO,aAAa,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;AAC3C,CAAC;AAFD,kCAEC;AAOD,SAAgB,YAAY,CAAC,MAAc;IACzC,OAAO,aAAa,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;AACnD,CAAC;AAFD,oCAEC;AAOD,SAAgB,WAAW,CAAC,KAAc;IACxC,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAA;IAErB,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;IAClD,IAAI,cAAc,KAAK,IAAI,EAAE;QAC3B,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,qCAAqC,CAAC,CAAA;KAC/D;IAED,IAAI,cAAc,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAA;IAEvD,cAAc,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAChD,OAAO,aAAa,CAAC,cAAc,CAAC,CAAA;AACtC,CAAC;AAZD,kCAYC;AAED,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,mBAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC5D,CAAC"}
@@ -1,23 +1,13 @@
1
1
  export interface Payload {
2
- event: string;
2
+ event?: string;
3
3
  event_id?: string;
4
4
  timestamp?: string;
5
+ type?: string;
6
+ properties?: {
7
+ [k: string]: unknown;
8
+ };
5
9
  phone_number?: string;
6
10
  email?: string;
7
- external_id?: string;
11
+ external_id: string;
8
12
  ttclid?: string;
9
- url?: string;
10
- referrer?: string;
11
- ip?: string;
12
- user_agent?: string;
13
- contents?: {
14
- price?: number;
15
- quantity?: number;
16
- content_type?: string;
17
- content_id?: string;
18
- }[];
19
- currency?: string;
20
- value?: number;
21
- description?: string;
22
- query?: string;
23
13
  }
@@ -8,8 +8,10 @@ const action = {
8
8
  event: {
9
9
  label: 'Event Name',
10
10
  type: 'string',
11
- required: true,
12
- description: 'Conversion event name. Please refer to the "Supported Web Events" section on in TikTok’s [Events API documentation](https://ads.tiktok.com/marketing_api/docs?id=1701890979375106) for accepted event names.'
11
+ description: 'Conversion event name. Please refer to the "Supported Web Events" section on this [page](https://ads.tiktok.com/marketing_api/docs?id=1701890979375106) for accepted event names.',
12
+ default: {
13
+ '@path': '$.event'
14
+ }
13
15
  },
14
16
  event_id: {
15
17
  label: 'Event ID',
@@ -22,14 +24,25 @@ const action = {
22
24
  timestamp: {
23
25
  label: 'Event Timestamp',
24
26
  type: 'string',
25
- description: 'Timestamp that the event took place, in ISO 8601 format.',
27
+ description: 'Timestamp that the event took place, in ISO 8601 format.'
28
+ },
29
+ type: {
30
+ label: 'Segment Event Type',
31
+ description: 'The Segment event type, e.g. "page".',
32
+ type: 'string',
26
33
  default: {
27
- '@path': '$.timestamp'
34
+ '@path': '$.type'
28
35
  }
29
36
  },
37
+ properties: {
38
+ label: 'Properties associated with the event',
39
+ description: 'Additional properties such as content info, description, and currency.',
40
+ type: 'object',
41
+ required: false
42
+ },
30
43
  phone_number: {
31
44
  label: 'Phone Number',
32
- description: 'Phone number of the user who triggered the conversion event, in E.164 standard format, e.g. +14150000000. Segment will hash this value before sending to TikTok.',
45
+ description: 'Phone number of the user who triggered the conversion event, in E.164 standard format, e.g. +14150000000.',
33
46
  type: 'string',
34
47
  default: {
35
48
  '@if': {
@@ -41,7 +54,7 @@ const action = {
41
54
  },
42
55
  email: {
43
56
  label: 'Email',
44
- description: 'Email address of the user who triggered the conversion event. Segment will hash this value before sending to TikTok.',
57
+ description: 'Email address of the user who triggered the conversion event.',
45
58
  type: 'string',
46
59
  format: 'email',
47
60
  default: {
@@ -54,8 +67,9 @@ const action = {
54
67
  },
55
68
  external_id: {
56
69
  label: 'External ID',
57
- description: 'Uniquely identifies the user who triggered the conversion event. Segment will hash this value before sending to TikTok.',
70
+ description: 'Uniquely identifies the user who triggered the conversion event.',
58
71
  type: 'string',
72
+ required: true,
59
73
  default: {
60
74
  '@if': {
61
75
  exists: { '@path': '$.userId' },
@@ -75,166 +89,15 @@ const action = {
75
89
  else: { '@path': '$.traits.ttclid' }
76
90
  }
77
91
  }
78
- },
79
- url: {
80
- label: 'Page URL',
81
- type: 'string',
82
- description: 'The page URL where the conversion event took place.',
83
- default: {
84
- '@path': '$.context.page.url'
85
- }
86
- },
87
- referrer: {
88
- label: 'Page Referrer',
89
- type: 'string',
90
- description: 'The page referrer.',
91
- default: {
92
- '@path': '$.context.page.referrer'
93
- }
94
- },
95
- ip: {
96
- label: 'IP Address',
97
- type: 'string',
98
- description: 'IP address of the browser.',
99
- default: {
100
- '@path': '$.context.ip'
101
- }
102
- },
103
- user_agent: {
104
- label: 'User Agent',
105
- type: 'string',
106
- description: 'User agent from the user’s device.',
107
- default: {
108
- '@path': '$.context.userAgent'
109
- }
110
- },
111
- contents: {
112
- label: 'Contents',
113
- type: 'object',
114
- multiple: true,
115
- description: 'Related items in a web event.',
116
- default: {
117
- '@if': {
118
- exists: {
119
- '@arrayPath': [
120
- '$.properties.products',
121
- {
122
- price: {
123
- '@path': '$.price'
124
- },
125
- quantity: {
126
- '@path': '$.quantity'
127
- },
128
- content_type: {
129
- '@path': '$.content_type'
130
- },
131
- content_id: {
132
- '@path': '$.content_id'
133
- }
134
- }
135
- ]
136
- },
137
- then: {
138
- '@arrayPath': [
139
- '$.properties.products',
140
- {
141
- price: {
142
- '@path': '$.price'
143
- },
144
- quantity: {
145
- '@path': '$.quantity'
146
- },
147
- content_type: {
148
- '@path': '$.content_type'
149
- },
150
- content_id: {
151
- '@path': '$.content_id'
152
- }
153
- }
154
- ]
155
- },
156
- else: {
157
- '@arrayPath': [
158
- '$.properties',
159
- {
160
- price: {
161
- '@path': '$.price'
162
- },
163
- quantity: {
164
- '@path': '$.quantity'
165
- },
166
- content_type: {
167
- '@path': '$.content_type'
168
- },
169
- content_id: {
170
- '@path': '$.content_id'
171
- }
172
- }
173
- ]
174
- }
175
- }
176
- },
177
- properties: {
178
- price: {
179
- label: 'Price',
180
- description: 'Price of the item.',
181
- type: 'number'
182
- },
183
- quantity: {
184
- label: 'Quantity',
185
- description: 'Number of items.',
186
- type: 'number'
187
- },
188
- content_type: {
189
- label: 'Content Type',
190
- description: 'Type of the product item.',
191
- type: 'string'
192
- },
193
- content_id: {
194
- label: 'Content ID',
195
- description: 'ID of the product item.',
196
- type: 'string'
197
- }
198
- }
199
- },
200
- currency: {
201
- label: 'Currency',
202
- type: 'string',
203
- description: 'Currency for the value specified as ISO 4217 code.',
204
- default: {
205
- '@path': '$.properties.currency'
206
- }
207
- },
208
- value: {
209
- label: 'Value',
210
- type: 'number',
211
- description: 'Value of the order or items sold.',
212
- default: {
213
- '@if': {
214
- exists: { '@path': '$.properties.value' },
215
- then: { '@path': '$.properties.value' },
216
- else: { '@path': '$.properties.revenue' }
217
- }
218
- }
219
- },
220
- description: {
221
- label: 'Description',
222
- type: 'string',
223
- description: 'A string description of the web event.'
224
- },
225
- query: {
226
- label: 'Query',
227
- type: 'string',
228
- description: 'The text string that was searched for.',
229
- default: {
230
- '@path': '$.properties.query'
231
- }
232
92
  }
233
93
  },
234
94
  perform: (request, { payload, settings }) => {
95
+ const eventId = payload.event_id
96
+ ? payload.event_id.toString() + '_' + (Math.random() + 1).toString(36).substring(7)
97
+ : '';
235
98
  const userData = {
236
99
  hashedExternalId: formatter_1.formatUserId(payload.external_id),
237
- hashedEmail: formatter_1.formatEmail(payload.email),
100
+ hashedEmail: formatter_1.formatEmail(payload.email || ''),
238
101
  hashedPhoneNumber: formatter_1.formatPhone(payload.phone_number)
239
102
  };
240
103
  return request('https://business-api.tiktok.com/open_api/v1.2/pixel/track/', {
@@ -242,7 +105,7 @@ const action = {
242
105
  json: {
243
106
  pixel_code: settings.pixel_code,
244
107
  event: payload.event,
245
- event_id: payload.event_id,
108
+ event_id: eventId,
246
109
  timestamp: payload.timestamp,
247
110
  context: {
248
111
  user: {
@@ -252,20 +115,7 @@ const action = {
252
115
  },
253
116
  ad: {
254
117
  callback: payload.ttclid
255
- },
256
- page: {
257
- url: payload.url,
258
- referrer: payload.referrer
259
- },
260
- ip: payload.ip,
261
- user_agent: payload.user_agent
262
- },
263
- properties: {
264
- contents: payload.contents,
265
- currency: payload.currency,
266
- value: payload.value,
267
- description: payload.description,
268
- query: payload.query
118
+ }
269
119
  }
270
120
  }
271
121
  });