You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// No existing customer is found, find the click event and create a new customer (for sale tracking without a pre-existing lead event)
126
+
// No existing customer is found, find the click event and create a new customer (for direct sale tracking)
127
127
else{
128
128
if(!clickId){
129
129
waitUntil(
130
130
logConversionEvent({
131
131
workspace_id: workspace.id,
132
132
path: "/track/sale",
133
133
body: JSON.stringify(rawBody),
134
-
error: `No existing customer with the provided customerExternalId (${customerExternalId}) was found, and there was no clickId provided for sale tracking without a pre-existing lead event.`,
134
+
error: `No existing customer with the provided customerExternalId (${customerExternalId}) was found, and there was no clickId provided for direct sale tracking.`,
"Additional metadata to be stored with the sale event. Max 10,000 characters when stringified.",
59
59
),
60
-
// advanced fields: leadEventName + fields for sale tracking without a pre-existing lead event
60
+
// advanced fields: leadEventName + fields for sale tracking without a lead event
61
61
leadEventName: z
62
62
.string()
63
63
.nullish()
64
64
.default(null)
65
65
.describe(
66
-
"The name of the lead event that occurred before the sale (case-sensitive). This is used to associate the sale event with a particular lead event (instead of the latest lead event for a link-customer combination, which is the default behavior). For sale tracking without a pre-existing lead event, this field can also be used to specify the lead event name.",
66
+
"The name of the lead event that occurred before the sale (case-sensitive). This is used to associate the sale event with a particular lead event (instead of the latest lead event for a link-customer combination, which is the default behavior). For direct sale tracking, this field can also be used to specify the lead event name.",
67
67
)
68
68
.openapi({example: "Cloned template 1481267"}),
69
69
clickId: z
70
70
.string()
71
71
.trim()
72
72
.nullish()
73
73
.describe(
74
-
"[For sale tracking without a pre-existing lead event]: The unique ID of the click that the sale conversion event is attributed to. You can read this value from `dub_id` cookie.",
74
+
"[For direct sale tracking]: The unique ID of the click that the sale conversion event is attributed to. You can read this value from `dub_id` cookie.",
75
75
),
76
76
customerName: z
77
77
.string()
78
78
.max(100)
79
79
.nullish()
80
80
.default(null)
81
81
.describe(
82
-
"[For sale tracking without a pre-existing lead event]: The name of the customer. If not passed, a random name will be generated (e.g. “Big Red Caribou”).",
82
+
"[For direct sale tracking]: The name of the customer. If not passed, a random name will be generated (e.g. “Big Red Caribou”).",
83
83
),
84
84
customerEmail: z
85
85
.string()
86
86
.email()
87
87
.max(100)
88
88
.nullish()
89
89
.default(null)
90
-
.describe(
91
-
"[For sale tracking without a pre-existing lead event]: The email address of the customer.",
92
-
),
90
+
.describe("[For direct sale tracking]: The email address of the customer."),
93
91
customerAvatar: z
94
92
.string()
95
93
.nullish()
96
94
.default(null)
97
-
.describe(
98
-
"[For sale tracking without a pre-existing lead event]: The avatar URL of the customer.",
99
-
),
95
+
.describe("[For direct sale tracking]: The avatar URL of the customer."),
0 commit comments