@li2/analytics 0.1.9 → 0.2.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.
- package/README.md +358 -358
- package/dist/index.d.mts +49 -5
- package/dist/index.d.ts +49 -5
- package/dist/index.global.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/outbound.global.js +1 -1
- package/dist/outbound.js +1 -1
- package/dist/outbound.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -25,8 +25,8 @@ interface TrackLeadParams {
|
|
|
25
25
|
clickId?: string;
|
|
26
26
|
/** The name of the lead event (required) */
|
|
27
27
|
eventName: string;
|
|
28
|
-
/** The unique customer ID in your system (
|
|
29
|
-
customerExternalId
|
|
28
|
+
/** The unique customer ID in your system (optional for anonymous tracking) */
|
|
29
|
+
customerExternalId?: string;
|
|
30
30
|
/** The name of the customer */
|
|
31
31
|
customerName?: string;
|
|
32
32
|
/** The email address of the customer */
|
|
@@ -93,8 +93,8 @@ interface ServerTrackLeadParams {
|
|
|
93
93
|
clickId: string;
|
|
94
94
|
/** The name of the lead event (required) */
|
|
95
95
|
eventName: string;
|
|
96
|
-
/** The unique customer ID in your system (
|
|
97
|
-
customerExternalId
|
|
96
|
+
/** The unique customer ID in your system (optional for anonymous tracking) */
|
|
97
|
+
customerExternalId?: string;
|
|
98
98
|
/** The name of the customer */
|
|
99
99
|
customerName?: string;
|
|
100
100
|
/** The email address of the customer */
|
|
@@ -164,12 +164,26 @@ declare class Li2Analytics {
|
|
|
164
164
|
isTrackingAvailable(): boolean;
|
|
165
165
|
/**
|
|
166
166
|
* Track a lead conversion event
|
|
167
|
+
* Supports both identified (with customerExternalId) and anonymous (without) tracking
|
|
167
168
|
*/
|
|
168
169
|
trackLead(params: TrackLeadParams): Promise<TrackLeadResponse>;
|
|
169
170
|
/**
|
|
170
171
|
* Track a sale conversion event
|
|
171
172
|
*/
|
|
172
173
|
trackSale(params: TrackSaleParams): Promise<TrackSaleResponse>;
|
|
174
|
+
/**
|
|
175
|
+
* Identify an anonymous user by linking them to a customer ID
|
|
176
|
+
* This triggers a merge of any anonymous tracking data into the identified customer
|
|
177
|
+
*/
|
|
178
|
+
identify(params: {
|
|
179
|
+
customerExternalId: string;
|
|
180
|
+
customerEmail?: string;
|
|
181
|
+
customerName?: string;
|
|
182
|
+
}): Promise<{
|
|
183
|
+
success: boolean;
|
|
184
|
+
customerId?: string;
|
|
185
|
+
message?: string;
|
|
186
|
+
}>;
|
|
173
187
|
}
|
|
174
188
|
/**
|
|
175
189
|
* Server-side Li2 Analytics SDK
|
|
@@ -181,6 +195,7 @@ declare class Li2ServerAnalytics {
|
|
|
181
195
|
private log;
|
|
182
196
|
/**
|
|
183
197
|
* Track a lead conversion event (server-side)
|
|
198
|
+
* Supports both identified (with customerExternalId) and anonymous (without) tracking
|
|
184
199
|
* @param params - Lead tracking parameters (clickId is REQUIRED)
|
|
185
200
|
*/
|
|
186
201
|
trackLead(params: ServerTrackLeadParams): Promise<TrackLeadResponse>;
|
|
@@ -189,6 +204,21 @@ declare class Li2ServerAnalytics {
|
|
|
189
204
|
* @param params - Sale tracking parameters (clickId is REQUIRED)
|
|
190
205
|
*/
|
|
191
206
|
trackSale(params: ServerTrackSaleParams): Promise<TrackSaleResponse>;
|
|
207
|
+
/**
|
|
208
|
+
* Identify an anonymous user by linking them to a customer ID (server-side)
|
|
209
|
+
* This triggers a merge of any anonymous tracking data into the identified customer
|
|
210
|
+
* @param params - Identification parameters (clickId and customerExternalId are REQUIRED)
|
|
211
|
+
*/
|
|
212
|
+
identify(params: {
|
|
213
|
+
clickId: string;
|
|
214
|
+
customerExternalId: string;
|
|
215
|
+
customerEmail?: string;
|
|
216
|
+
customerName?: string;
|
|
217
|
+
}): Promise<{
|
|
218
|
+
success: boolean;
|
|
219
|
+
customerId?: string;
|
|
220
|
+
message?: string;
|
|
221
|
+
}>;
|
|
192
222
|
}
|
|
193
223
|
/**
|
|
194
224
|
* Initialize the Li2 Analytics SDK
|
|
@@ -218,6 +248,19 @@ declare function isTrackingAvailable(): boolean;
|
|
|
218
248
|
* Convenience function that uses the singleton instance
|
|
219
249
|
*/
|
|
220
250
|
declare function getClickId(): string | null;
|
|
251
|
+
/**
|
|
252
|
+
* Identify an anonymous user
|
|
253
|
+
* Convenience function that uses the singleton instance
|
|
254
|
+
*/
|
|
255
|
+
declare function identify(params: {
|
|
256
|
+
customerExternalId: string;
|
|
257
|
+
customerEmail?: string;
|
|
258
|
+
customerName?: string;
|
|
259
|
+
}): Promise<{
|
|
260
|
+
success: boolean;
|
|
261
|
+
customerId?: string;
|
|
262
|
+
message?: string;
|
|
263
|
+
}>;
|
|
221
264
|
|
|
222
265
|
/**
|
|
223
266
|
* Initialize the server-side Li2 Analytics SDK
|
|
@@ -229,9 +272,10 @@ declare const _default: {
|
|
|
229
272
|
getInstance: typeof getInstance;
|
|
230
273
|
trackLead: typeof trackLead;
|
|
231
274
|
trackSale: typeof trackSale;
|
|
275
|
+
identify: typeof identify;
|
|
232
276
|
isTrackingAvailable: typeof isTrackingAvailable;
|
|
233
277
|
getClickId: typeof getClickId;
|
|
234
278
|
initServer: typeof initServer;
|
|
235
279
|
};
|
|
236
280
|
|
|
237
|
-
export { type CookieOptions, Li2Analytics, type Li2Config, Li2ServerAnalytics, type Li2ServerConfig, type ServerTrackLeadParams, type ServerTrackSaleParams, type TrackLeadParams, type TrackLeadResponse, type TrackSaleParams, type TrackSaleResponse, _default as default, getClickId, getInstance, init, initServer, isTrackingAvailable, trackLead, trackSale };
|
|
281
|
+
export { type CookieOptions, Li2Analytics, type Li2Config, Li2ServerAnalytics, type Li2ServerConfig, type ServerTrackLeadParams, type ServerTrackSaleParams, type TrackLeadParams, type TrackLeadResponse, type TrackSaleParams, type TrackSaleResponse, _default as default, getClickId, getInstance, identify, init, initServer, isTrackingAvailable, trackLead, trackSale };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ interface TrackLeadParams {
|
|
|
25
25
|
clickId?: string;
|
|
26
26
|
/** The name of the lead event (required) */
|
|
27
27
|
eventName: string;
|
|
28
|
-
/** The unique customer ID in your system (
|
|
29
|
-
customerExternalId
|
|
28
|
+
/** The unique customer ID in your system (optional for anonymous tracking) */
|
|
29
|
+
customerExternalId?: string;
|
|
30
30
|
/** The name of the customer */
|
|
31
31
|
customerName?: string;
|
|
32
32
|
/** The email address of the customer */
|
|
@@ -93,8 +93,8 @@ interface ServerTrackLeadParams {
|
|
|
93
93
|
clickId: string;
|
|
94
94
|
/** The name of the lead event (required) */
|
|
95
95
|
eventName: string;
|
|
96
|
-
/** The unique customer ID in your system (
|
|
97
|
-
customerExternalId
|
|
96
|
+
/** The unique customer ID in your system (optional for anonymous tracking) */
|
|
97
|
+
customerExternalId?: string;
|
|
98
98
|
/** The name of the customer */
|
|
99
99
|
customerName?: string;
|
|
100
100
|
/** The email address of the customer */
|
|
@@ -164,12 +164,26 @@ declare class Li2Analytics {
|
|
|
164
164
|
isTrackingAvailable(): boolean;
|
|
165
165
|
/**
|
|
166
166
|
* Track a lead conversion event
|
|
167
|
+
* Supports both identified (with customerExternalId) and anonymous (without) tracking
|
|
167
168
|
*/
|
|
168
169
|
trackLead(params: TrackLeadParams): Promise<TrackLeadResponse>;
|
|
169
170
|
/**
|
|
170
171
|
* Track a sale conversion event
|
|
171
172
|
*/
|
|
172
173
|
trackSale(params: TrackSaleParams): Promise<TrackSaleResponse>;
|
|
174
|
+
/**
|
|
175
|
+
* Identify an anonymous user by linking them to a customer ID
|
|
176
|
+
* This triggers a merge of any anonymous tracking data into the identified customer
|
|
177
|
+
*/
|
|
178
|
+
identify(params: {
|
|
179
|
+
customerExternalId: string;
|
|
180
|
+
customerEmail?: string;
|
|
181
|
+
customerName?: string;
|
|
182
|
+
}): Promise<{
|
|
183
|
+
success: boolean;
|
|
184
|
+
customerId?: string;
|
|
185
|
+
message?: string;
|
|
186
|
+
}>;
|
|
173
187
|
}
|
|
174
188
|
/**
|
|
175
189
|
* Server-side Li2 Analytics SDK
|
|
@@ -181,6 +195,7 @@ declare class Li2ServerAnalytics {
|
|
|
181
195
|
private log;
|
|
182
196
|
/**
|
|
183
197
|
* Track a lead conversion event (server-side)
|
|
198
|
+
* Supports both identified (with customerExternalId) and anonymous (without) tracking
|
|
184
199
|
* @param params - Lead tracking parameters (clickId is REQUIRED)
|
|
185
200
|
*/
|
|
186
201
|
trackLead(params: ServerTrackLeadParams): Promise<TrackLeadResponse>;
|
|
@@ -189,6 +204,21 @@ declare class Li2ServerAnalytics {
|
|
|
189
204
|
* @param params - Sale tracking parameters (clickId is REQUIRED)
|
|
190
205
|
*/
|
|
191
206
|
trackSale(params: ServerTrackSaleParams): Promise<TrackSaleResponse>;
|
|
207
|
+
/**
|
|
208
|
+
* Identify an anonymous user by linking them to a customer ID (server-side)
|
|
209
|
+
* This triggers a merge of any anonymous tracking data into the identified customer
|
|
210
|
+
* @param params - Identification parameters (clickId and customerExternalId are REQUIRED)
|
|
211
|
+
*/
|
|
212
|
+
identify(params: {
|
|
213
|
+
clickId: string;
|
|
214
|
+
customerExternalId: string;
|
|
215
|
+
customerEmail?: string;
|
|
216
|
+
customerName?: string;
|
|
217
|
+
}): Promise<{
|
|
218
|
+
success: boolean;
|
|
219
|
+
customerId?: string;
|
|
220
|
+
message?: string;
|
|
221
|
+
}>;
|
|
192
222
|
}
|
|
193
223
|
/**
|
|
194
224
|
* Initialize the Li2 Analytics SDK
|
|
@@ -218,6 +248,19 @@ declare function isTrackingAvailable(): boolean;
|
|
|
218
248
|
* Convenience function that uses the singleton instance
|
|
219
249
|
*/
|
|
220
250
|
declare function getClickId(): string | null;
|
|
251
|
+
/**
|
|
252
|
+
* Identify an anonymous user
|
|
253
|
+
* Convenience function that uses the singleton instance
|
|
254
|
+
*/
|
|
255
|
+
declare function identify(params: {
|
|
256
|
+
customerExternalId: string;
|
|
257
|
+
customerEmail?: string;
|
|
258
|
+
customerName?: string;
|
|
259
|
+
}): Promise<{
|
|
260
|
+
success: boolean;
|
|
261
|
+
customerId?: string;
|
|
262
|
+
message?: string;
|
|
263
|
+
}>;
|
|
221
264
|
|
|
222
265
|
/**
|
|
223
266
|
* Initialize the server-side Li2 Analytics SDK
|
|
@@ -229,9 +272,10 @@ declare const _default: {
|
|
|
229
272
|
getInstance: typeof getInstance;
|
|
230
273
|
trackLead: typeof trackLead;
|
|
231
274
|
trackSale: typeof trackSale;
|
|
275
|
+
identify: typeof identify;
|
|
232
276
|
isTrackingAvailable: typeof isTrackingAvailable;
|
|
233
277
|
getClickId: typeof getClickId;
|
|
234
278
|
initServer: typeof initServer;
|
|
235
279
|
};
|
|
236
280
|
|
|
237
|
-
export { type CookieOptions, Li2Analytics, type Li2Config, Li2ServerAnalytics, type Li2ServerConfig, type ServerTrackLeadParams, type ServerTrackSaleParams, type TrackLeadParams, type TrackLeadResponse, type TrackSaleParams, type TrackSaleResponse, _default as default, getClickId, getInstance, init, initServer, isTrackingAvailable, trackLead, trackSale };
|
|
281
|
+
export { type CookieOptions, Li2Analytics, type Li2Config, Li2ServerAnalytics, type Li2ServerConfig, type ServerTrackLeadParams, type ServerTrackSaleParams, type TrackLeadParams, type TrackLeadResponse, type TrackSaleParams, type TrackSaleResponse, _default as default, getClickId, getInstance, identify, init, initServer, isTrackingAvailable, trackLead, trackSale };
|