@aacigroup/aaci_shared 2.3.0 → 2.6.0
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 +491 -62
- package/dist/LeadTracker.d.ts.map +1 -1
- package/dist/LeadTracker.js +5 -0
- package/dist/LeadTracker.js.map +1 -1
- package/dist/TrackingContext.d.ts +19 -0
- package/dist/TrackingContext.d.ts.map +1 -0
- package/dist/TrackingContext.js +58 -0
- package/dist/TrackingContext.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +3 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +9 -0
- package/dist/react.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/validation.d.ts +306 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +93 -0
- package/dist/validation.js.map +1 -0
- package/package.json +23 -4
package/README.md
CHANGED
|
@@ -12,41 +12,141 @@ npm install @aacigroup/aaci_shared
|
|
|
12
12
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
15
|
-
### Lead Tracking
|
|
16
15
|
```javascript
|
|
17
16
|
import { LeadTracker } from '@aacigroup/aaci_shared';
|
|
18
17
|
|
|
19
|
-
const
|
|
18
|
+
const tracker = new LeadTracker({
|
|
20
19
|
apiUrl: 'https://your-api.com/leads',
|
|
21
20
|
apiKey: 'your-api-key',
|
|
22
21
|
projectName: 'MyProject',
|
|
23
22
|
productionDomains: ['myproject.com']
|
|
24
23
|
});
|
|
25
24
|
|
|
26
|
-
// Track lead only
|
|
27
|
-
await
|
|
28
|
-
lead_type: '
|
|
29
|
-
email: 'user@example.com'
|
|
30
|
-
first_name: 'John',
|
|
31
|
-
last_name: 'Doe'
|
|
25
|
+
// Track lead only
|
|
26
|
+
await tracker.trackLeadAndAddress({
|
|
27
|
+
lead_type: 'contact',
|
|
28
|
+
email: 'user@example.com'
|
|
32
29
|
});
|
|
33
30
|
|
|
34
|
-
// Track address only
|
|
35
|
-
await
|
|
36
|
-
full_address: '123 Main St, New York, NY 10001'
|
|
31
|
+
// Track address only
|
|
32
|
+
await tracker.trackLeadAndAddress(undefined, {
|
|
33
|
+
full_address: '123 Main St, New York, NY 10001',
|
|
34
|
+
source: 'address_check'
|
|
37
35
|
});
|
|
38
36
|
|
|
39
|
-
// Track both
|
|
40
|
-
await
|
|
41
|
-
lead_type: '
|
|
42
|
-
email: 'user@example.com'
|
|
43
|
-
phone: '+1234567890'
|
|
37
|
+
// Track both together
|
|
38
|
+
await tracker.trackLeadAndAddress({
|
|
39
|
+
lead_type: 'policy_review',
|
|
40
|
+
email: 'user@example.com'
|
|
44
41
|
}, {
|
|
45
42
|
full_address: '123 Main St, New York, NY 10001',
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
source: 'policy_review'
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Lead Types
|
|
48
|
+
|
|
49
|
+
Use these values for `lead_type` and `source`:
|
|
50
|
+
- `'policy_review'` - Insurance policy review
|
|
51
|
+
- `'address_check'` - Property address verification
|
|
52
|
+
- `'contact'` - General contact forms
|
|
53
|
+
- `'signup'` - User registration
|
|
54
|
+
- `'consultation'` - Service consultation
|
|
55
|
+
- `'quote'` - Price quote requests
|
|
56
|
+
|
|
57
|
+
## Validation (Optional)
|
|
58
|
+
|
|
59
|
+
Install Zod for input validation:
|
|
60
|
+
```bash
|
|
61
|
+
npm install zod
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
import { validateTrackLeadParams, validateAddress } from '@aacigroup/aaci_shared';
|
|
66
|
+
|
|
67
|
+
// Validate before tracking
|
|
68
|
+
const validLead = validateTrackLeadParams({
|
|
69
|
+
lead_type: 'contact',
|
|
70
|
+
email: 'user@example.com'
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const validAddress = validateAddress({
|
|
74
|
+
full_address: '123 Main St',
|
|
75
|
+
source: 'contact'
|
|
49
76
|
});
|
|
77
|
+
|
|
78
|
+
await tracker.trackLeadAndAddress(validLead, validAddress);
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Other Components
|
|
82
|
+
|
|
83
|
+
### React Context (Optional)
|
|
84
|
+
|
|
85
|
+
For React projects, you can use the provided context for easier integration:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm install react # Peer dependency
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
```javascript
|
|
92
|
+
// App.tsx
|
|
93
|
+
import { TrackingProvider, createTrackingConfigFromEnv } from '@aacigroup/aaci_shared/react';
|
|
94
|
+
|
|
95
|
+
// Option 1: Use environment variables (in Vite projects)
|
|
96
|
+
function App() {
|
|
97
|
+
return (
|
|
98
|
+
<TrackingProvider config={createTrackingConfigFromEnv()}>
|
|
99
|
+
<YourApp />
|
|
100
|
+
</TrackingProvider>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Option 2: Manual configuration
|
|
105
|
+
function App() {
|
|
106
|
+
const trackingConfig = {
|
|
107
|
+
apiUrl: 'https://your-api.com/leads',
|
|
108
|
+
apiKey: 'your-api-key',
|
|
109
|
+
projectName: 'MyProject',
|
|
110
|
+
posthogKey: 'phc_your_key',
|
|
111
|
+
productionDomains: ['myproject.com']
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<TrackingProvider config={trackingConfig}>
|
|
116
|
+
<YourApp />
|
|
117
|
+
</TrackingProvider>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Component.tsx - Use tracking in any component
|
|
122
|
+
import { useLeadTracker, usePostHog } from '@aacigroup/aaci_shared/react';
|
|
123
|
+
|
|
124
|
+
function ContactForm() {
|
|
125
|
+
const tracker = useLeadTracker();
|
|
126
|
+
const analytics = usePostHog();
|
|
127
|
+
|
|
128
|
+
const handleSubmit = async (formData) => {
|
|
129
|
+
// Track lead submission
|
|
130
|
+
await tracker.trackLeadAndAddress({
|
|
131
|
+
lead_type: 'contact',
|
|
132
|
+
email: formData.email
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// Track analytics event
|
|
136
|
+
analytics.trackEvent('form_submitted', { form_type: 'contact' });
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return <form onSubmit={handleSubmit}>...</form>;
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Environment Variables (for createTrackingConfigFromEnv):**
|
|
144
|
+
```env
|
|
145
|
+
VITE_LEAD_CAPTURE_API_URL=https://your-api.com/leads
|
|
146
|
+
VITE_LEAD_CAPTURE_API_KEY=your-api-key
|
|
147
|
+
VITE_PROJECT_NAME=MyProject
|
|
148
|
+
VITE_POSTHOG_KEY=phc_your_key
|
|
149
|
+
VITE_PRODUCTION_DOMAINS=myproject.com,www.myproject.com
|
|
50
150
|
```
|
|
51
151
|
|
|
52
152
|
### PostHog Analytics
|
|
@@ -61,7 +161,6 @@ const analytics = new PostHog({
|
|
|
61
161
|
|
|
62
162
|
await analytics.init();
|
|
63
163
|
analytics.trackEvent('user_signup', { plan: 'premium' });
|
|
64
|
-
analytics.trackError(error, 'context'); // Built-in error tracking
|
|
65
164
|
```
|
|
66
165
|
|
|
67
166
|
### Google Tag Manager
|
|
@@ -75,79 +174,409 @@ const gtm = new GTM({
|
|
|
75
174
|
gtm.trackEvent('purchase', { value: 100, currency: 'USD' });
|
|
76
175
|
```
|
|
77
176
|
|
|
78
|
-
|
|
177
|
+
## TypeScript Types
|
|
178
|
+
|
|
79
179
|
```javascript
|
|
80
|
-
import {
|
|
180
|
+
import type { Lead, AddressCapture, TrackLeadParams, Address } from '@aacigroup/aaci_shared';
|
|
81
181
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
182
|
+
// Use types in your application
|
|
183
|
+
function processLead(lead: Lead): void {
|
|
184
|
+
console.log(`Processing ${lead.email}`);
|
|
185
|
+
}
|
|
186
|
+
```
|
|
85
187
|
|
|
86
|
-
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
ISC
|
|
191
|
+
|
|
192
|
+
## Core API Reference
|
|
193
|
+
|
|
194
|
+
### LeadTracker
|
|
195
|
+
|
|
196
|
+
#### `trackLeadAndAddress(lead?, address?)`
|
|
197
|
+
|
|
198
|
+
**Primary tracking method that accepts lead data, address data, or both.**
|
|
199
|
+
|
|
200
|
+
**Parameters:**
|
|
201
|
+
- `lead` (optional): Lead information object
|
|
202
|
+
- `address` (optional): Address information object
|
|
203
|
+
- **At least one parameter is required**
|
|
204
|
+
|
|
205
|
+
**Returns:** `Promise<LeadTrackingResponse>`
|
|
206
|
+
|
|
207
|
+
#### Lead Capture Types
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
interface TrackLeadParams {
|
|
211
|
+
lead_type: string; // Required: Type of lead
|
|
212
|
+
first_name?: string; // Optional: First name
|
|
213
|
+
last_name?: string; // Optional: Last name
|
|
214
|
+
email?: string; // Optional: Email address
|
|
215
|
+
phone?: string; // Optional: Phone number
|
|
216
|
+
extra_data?: Record<string, any>; // Optional: Additional custom data
|
|
217
|
+
session_data?: SessionData; // Optional: Session tracking data (auto-populated)
|
|
218
|
+
}
|
|
87
219
|
```
|
|
88
220
|
|
|
89
|
-
|
|
221
|
+
**Common `lead_type` examples:**
|
|
222
|
+
- `'policy_review'` - Insurance policy review requests
|
|
223
|
+
- `'address_check'` - Property address verification
|
|
224
|
+
- `'contact'` - General contact form submissions
|
|
225
|
+
- `'signup'` - User registration/signup
|
|
226
|
+
- `'consultation'` - Service consultation requests
|
|
227
|
+
- `'quote'` - Price quote requests
|
|
228
|
+
|
|
229
|
+
**Lead Validation:**
|
|
230
|
+
- When tracking a lead, either `email` OR `phone` is required
|
|
231
|
+
- `lead_type` is always required
|
|
232
|
+
|
|
233
|
+
#### Address Capture Types
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
interface Address {
|
|
237
|
+
full_address: string; // Required: Complete address string
|
|
238
|
+
source: string; // Required: Lead type that generated this address
|
|
239
|
+
street_address?: string; // Optional: Street address component
|
|
240
|
+
city?: string; // Optional: City
|
|
241
|
+
state?: string; // Optional: State/Province
|
|
242
|
+
zip_code?: string; // Optional: ZIP/Postal code
|
|
243
|
+
county?: string; // Optional: County
|
|
244
|
+
country?: string; // Optional: Country
|
|
245
|
+
extra_data?: Record<string, any>; // Optional: Additional address data
|
|
246
|
+
}
|
|
247
|
+
```
|
|
90
248
|
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
- **PostHog Integration** - Uses PostHog distinct_id when available
|
|
95
|
-
- **TypeScript Support** - Full type definitions
|
|
96
|
-
- **Framework Agnostic** - Works with any JS framework
|
|
97
|
-
- **Lovable.dev Compatible** - No environment variables needed
|
|
249
|
+
**Address Validation:**
|
|
250
|
+
- `full_address` is always required
|
|
251
|
+
- `source` is always required (uses same values as `lead_type`)
|
|
98
252
|
|
|
99
|
-
|
|
253
|
+
#### Usage Examples
|
|
100
254
|
|
|
101
|
-
|
|
102
|
-
|
|
255
|
+
```javascript
|
|
256
|
+
// 1. Lead only - Basic contact form
|
|
257
|
+
await tracker.trackLeadAndAddress({
|
|
258
|
+
lead_type: 'contact',
|
|
259
|
+
email: 'user@example.com',
|
|
260
|
+
first_name: 'John'
|
|
261
|
+
});
|
|
103
262
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
263
|
+
// 2. Lead only - Policy review request
|
|
264
|
+
await tracker.trackLeadAndAddress({
|
|
265
|
+
lead_type: 'policy_review',
|
|
266
|
+
phone: '+1234567890',
|
|
267
|
+
extra_data: { policy_number: 'POL123456' }
|
|
268
|
+
});
|
|
108
269
|
|
|
109
|
-
|
|
270
|
+
// 3. Address only - Address verification
|
|
271
|
+
await tracker.trackLeadAndAddress(undefined, {
|
|
272
|
+
full_address: '123 Main St, New York, NY 10001',
|
|
273
|
+
source: 'address_check',
|
|
274
|
+
city: 'New York',
|
|
275
|
+
state: 'NY',
|
|
276
|
+
zip_code: '10001'
|
|
277
|
+
});
|
|
110
278
|
|
|
111
|
-
|
|
112
|
-
|
|
279
|
+
// 4. Both together - Address check with contact
|
|
280
|
+
await tracker.trackLeadAndAddress({
|
|
281
|
+
lead_type: 'address_check',
|
|
282
|
+
email: 'homeowner@example.com',
|
|
283
|
+
first_name: 'Jane'
|
|
284
|
+
}, {
|
|
285
|
+
full_address: '456 Oak Ave, Boston, MA 02101',
|
|
286
|
+
source: 'address_check',
|
|
287
|
+
city: 'Boston',
|
|
288
|
+
state: 'MA',
|
|
289
|
+
zip_code: '02101'
|
|
290
|
+
});
|
|
113
291
|
|
|
114
|
-
|
|
292
|
+
// 5. Multi-step forms - Step 1: Lead info
|
|
293
|
+
await tracker.trackLeadAndAddress({
|
|
294
|
+
lead_type: 'quote',
|
|
295
|
+
email: 'customer@example.com'
|
|
296
|
+
});
|
|
297
|
+
// Step 2: Address info (automatically merges with saved lead)
|
|
298
|
+
await tracker.trackLeadAndAddress(undefined, {
|
|
299
|
+
full_address: '789 Pine St, Chicago, IL 60601',
|
|
300
|
+
source: 'quote'
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Input Validation
|
|
305
|
+
|
|
306
|
+
The library provides Zod validation schemas to validate customer input before tracking.
|
|
307
|
+
|
|
308
|
+
**Note:** Validation functions require the `zod` package to be installed in your project:
|
|
309
|
+
```bash
|
|
310
|
+
npm install zod
|
|
311
|
+
```
|
|
115
312
|
|
|
116
|
-
### LeadTracker
|
|
117
313
|
```javascript
|
|
118
|
-
|
|
119
|
-
|
|
314
|
+
import {
|
|
315
|
+
validateTrackLeadParams,
|
|
316
|
+
validateAddress,
|
|
317
|
+
safeValidateTrackLeadAndAddress
|
|
318
|
+
} from '@aacigroup/aaci_shared';
|
|
319
|
+
|
|
320
|
+
// Validate lead data (throws on error)
|
|
321
|
+
try {
|
|
322
|
+
const validLead = validateTrackLeadParams({
|
|
323
|
+
lead_type: 'contact',
|
|
324
|
+
email: 'user@example.com'
|
|
325
|
+
});
|
|
326
|
+
await tracker.trackLeadAndAddress(validLead);
|
|
327
|
+
} catch (error) {
|
|
328
|
+
console.error('Invalid lead data:', error.errors);
|
|
329
|
+
}
|
|
120
330
|
|
|
121
|
-
//
|
|
122
|
-
|
|
331
|
+
// Validate address data (throws on error)
|
|
332
|
+
try {
|
|
333
|
+
const validAddress = validateAddress({
|
|
334
|
+
full_address: '123 Main St, New York, NY 10001',
|
|
335
|
+
source: 'address_check'
|
|
336
|
+
});
|
|
337
|
+
await tracker.trackLeadAndAddress(undefined, validAddress);
|
|
338
|
+
} catch (error) {
|
|
339
|
+
console.error('Invalid address data:', error.errors);
|
|
340
|
+
}
|
|
123
341
|
|
|
124
|
-
//
|
|
125
|
-
|
|
342
|
+
// Safe validation (returns success/error object)
|
|
343
|
+
const result = safeValidateTrackLeadAndAddress(leadData, addressData);
|
|
344
|
+
if (result.success) {
|
|
345
|
+
await tracker.trackLeadAndAddress(result.data.lead, result.data.address);
|
|
346
|
+
} else {
|
|
347
|
+
console.error('Validation errors:', result.error.errors);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Available validation functions:
|
|
351
|
+
// validateTrackLeadParams(data) - throws on error
|
|
352
|
+
// validateAddress(data) - throws on error
|
|
353
|
+
// validateTrackLeadAndAddress(lead, address) - throws on error
|
|
354
|
+
// safeValidateTrackLeadParams(data) - returns {success, data, error}
|
|
355
|
+
// safeValidateAddress(data) - returns {success, data, error}
|
|
356
|
+
// safeValidateTrackLeadAndAddress(lead, address) - returns {success, data, error}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
#### Response Type
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
interface LeadTrackingResponse {
|
|
363
|
+
status: 'ok' | 'error'; // Success or error status
|
|
364
|
+
lead_id?: string; // Generated lead ID (on success)
|
|
365
|
+
address_id?: string; // Generated address ID (if address provided)
|
|
366
|
+
is_first_submission?: boolean; // Whether this is user's first submission
|
|
367
|
+
message?: string; // Success/error message
|
|
368
|
+
errors?: Array<{ // Validation errors (if any)
|
|
369
|
+
field: string;
|
|
370
|
+
message: string;
|
|
371
|
+
}>;
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
#### Other LeadTracker Methods
|
|
376
|
+
|
|
377
|
+
```javascript
|
|
378
|
+
// Get current session data
|
|
379
|
+
const sessionData = tracker.getSessionData();
|
|
380
|
+
|
|
381
|
+
// Check if running in production
|
|
382
|
+
const isProduction = tracker.isProduction();
|
|
126
383
|
```
|
|
127
384
|
|
|
128
|
-
### PostHog
|
|
385
|
+
### PostHog Analytics
|
|
386
|
+
|
|
129
387
|
```javascript
|
|
388
|
+
import { PostHog } from '@aacigroup/aaci_shared';
|
|
389
|
+
|
|
390
|
+
const analytics = new PostHog({
|
|
391
|
+
apiKey: 'phc_your_posthog_key',
|
|
392
|
+
projectName: 'MyProject',
|
|
393
|
+
productionDomains: ['myproject.com'],
|
|
394
|
+
apiHost: 'https://us.i.posthog.com', // Optional: Custom PostHog host
|
|
395
|
+
autocapture: true, // Optional: Enable autocapture (default: true)
|
|
396
|
+
capturePageview: true // Optional: Enable pageview tracking (default: true)
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
// Initialize PostHog
|
|
130
400
|
await analytics.init();
|
|
131
|
-
|
|
132
|
-
|
|
401
|
+
|
|
402
|
+
// Track events
|
|
403
|
+
analytics.trackEvent('user_signup', { plan: 'premium', source: 'landing_page' });
|
|
404
|
+
|
|
405
|
+
// Identify users
|
|
406
|
+
analytics.identify('user_123', { email: 'user@example.com', plan: 'premium' });
|
|
407
|
+
|
|
408
|
+
// Track errors
|
|
409
|
+
analytics.trackError(new Error('Something went wrong'), 'checkout_process');
|
|
410
|
+
analytics.trackAPIError('https://api.example.com/users', 500, 'Internal Server Error');
|
|
411
|
+
|
|
412
|
+
// Reset user identity
|
|
413
|
+
analytics.reset();
|
|
133
414
|
```
|
|
134
415
|
|
|
135
|
-
###
|
|
416
|
+
### Google Tag Manager
|
|
417
|
+
|
|
136
418
|
```javascript
|
|
137
|
-
|
|
419
|
+
import { GTM } from '@aacigroup/aaci_shared';
|
|
420
|
+
|
|
421
|
+
const gtm = new GTM({
|
|
422
|
+
productionDomains: ['myproject.com']
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
// Track events
|
|
426
|
+
gtm.trackEvent('purchase', {
|
|
427
|
+
value: 99.99,
|
|
428
|
+
currency: 'USD',
|
|
429
|
+
item_id: 'product_123'
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
// Check if GTM is available
|
|
433
|
+
if (gtm.isAvailable()) {
|
|
434
|
+
gtm.trackEvent('page_view', { page: '/checkout' });
|
|
435
|
+
}
|
|
138
436
|
```
|
|
139
437
|
|
|
140
|
-
###
|
|
438
|
+
### Environment Detection
|
|
439
|
+
|
|
141
440
|
```javascript
|
|
142
|
-
|
|
143
|
-
|
|
441
|
+
import { Environment } from '@aacigroup/aaci_shared';
|
|
442
|
+
|
|
443
|
+
const env = new Environment({
|
|
444
|
+
productionDomains: ['myproject.com', 'www.myproject.com']
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
console.log('Is production:', env.isProduction());
|
|
448
|
+
console.log('Current domain:', env.getCurrentDomain());
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
## Data Types Reference
|
|
452
|
+
|
|
453
|
+
### Input Types (for tracking methods)
|
|
454
|
+
|
|
455
|
+
```typescript
|
|
456
|
+
// Lead data for tracking
|
|
457
|
+
interface TrackLeadParams {
|
|
458
|
+
lead_type: string; // Required: Type of lead
|
|
459
|
+
first_name?: string; // Optional: First name
|
|
460
|
+
last_name?: string; // Optional: Last name
|
|
461
|
+
email?: string; // Optional: Email address
|
|
462
|
+
phone?: string; // Optional: Phone number
|
|
463
|
+
extra_data?: Record<string, any>; // Optional: Additional custom data
|
|
464
|
+
session_data?: SessionData; // Optional: Session tracking data (auto-populated)
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// Address data for tracking
|
|
468
|
+
interface Address {
|
|
469
|
+
full_address: string; // Required: Complete address string
|
|
470
|
+
source: string; // Required: Lead type that generated this address
|
|
471
|
+
street_address?: string; // Optional: Street address component
|
|
472
|
+
city?: string; // Optional: City
|
|
473
|
+
state?: string; // Optional: State/Province
|
|
474
|
+
zip_code?: string; // Optional: ZIP/Postal code
|
|
475
|
+
county?: string; // Optional: County
|
|
476
|
+
country?: string; // Optional: Country
|
|
477
|
+
extra_data?: Record<string, any>; // Optional: Additional address data
|
|
478
|
+
}
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Database Types (complete records)
|
|
482
|
+
|
|
483
|
+
```typescript
|
|
484
|
+
// Complete lead record (from database)
|
|
485
|
+
interface Lead {
|
|
486
|
+
id: string;
|
|
487
|
+
project_name: string;
|
|
488
|
+
user_id: string | null;
|
|
489
|
+
first_name: string | null;
|
|
490
|
+
last_name: string | null;
|
|
491
|
+
email: string | null;
|
|
492
|
+
phone: string | null;
|
|
493
|
+
lead_type: string | null;
|
|
494
|
+
first_submission: boolean | null;
|
|
495
|
+
extra_data: Record<string, any>;
|
|
496
|
+
session_data: SessionData;
|
|
497
|
+
created_at: string;
|
|
498
|
+
updated_at: string;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// Complete address record (from database)
|
|
502
|
+
interface AddressCapture {
|
|
503
|
+
id: string;
|
|
504
|
+
project_name: string;
|
|
505
|
+
user_id: string | null;
|
|
506
|
+
lead_id: string | null;
|
|
507
|
+
address: string | null;
|
|
508
|
+
city: string | null;
|
|
509
|
+
state: string | null;
|
|
510
|
+
zip: string | null;
|
|
511
|
+
source: string | null; // Lead type source (same values as lead_type)
|
|
512
|
+
status: string | null; // Processing status (e.g., 'verified', 'pending', 'invalid')
|
|
513
|
+
extra_data: Record<string, any>;
|
|
514
|
+
session_data: SessionData;
|
|
515
|
+
created_at: string;
|
|
516
|
+
updated_at: string;
|
|
517
|
+
}
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
**Common `lead_type` and `source` values:**
|
|
521
|
+
- `'policy_review'` - Insurance policy review requests
|
|
522
|
+
- `'address_check'` - Property address verification
|
|
523
|
+
- `'contact'` - General contact form submissions
|
|
524
|
+
- `'signup'` - User registration/signup
|
|
525
|
+
- `'consultation'` - Service consultation requests
|
|
526
|
+
- `'quote'` - Price quote requests
|
|
527
|
+
|
|
528
|
+
### Session Data
|
|
529
|
+
|
|
530
|
+
```typescript
|
|
531
|
+
// Session tracking data
|
|
532
|
+
interface SessionData {
|
|
533
|
+
ip?: string;
|
|
534
|
+
user_agent?: string;
|
|
535
|
+
browser?: string;
|
|
536
|
+
browser_version?: string;
|
|
537
|
+
os?: string;
|
|
538
|
+
device?: string;
|
|
539
|
+
referrer?: string;
|
|
540
|
+
utm_source?: string;
|
|
541
|
+
utm_medium?: string;
|
|
542
|
+
utm_campaign?: string;
|
|
543
|
+
landing_page?: string;
|
|
544
|
+
current_page?: string;
|
|
545
|
+
session_id?: string;
|
|
546
|
+
timestamp?: string;
|
|
547
|
+
distinct_id?: string;
|
|
548
|
+
gclid?: string; // Google Ads click ID
|
|
549
|
+
fbclid?: string; // Facebook click ID
|
|
550
|
+
fbc?: string; // Facebook browser cookie
|
|
551
|
+
fbp?: string; // Facebook pixel cookie
|
|
552
|
+
}
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### Import Types Only
|
|
556
|
+
|
|
557
|
+
```javascript
|
|
558
|
+
import type { Lead, AddressCapture, SessionData, TrackLeadParams, Address } from '@aacigroup/aaci_shared';
|
|
144
559
|
|
|
145
560
|
// Use in your application
|
|
146
|
-
function
|
|
147
|
-
|
|
561
|
+
function saveLead(lead: Lead): Promise<void> {
|
|
562
|
+
return database.leads.create(lead);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
function saveAddress(address: AddressCapture): Promise<void> {
|
|
566
|
+
return database.addresses.create(address);
|
|
148
567
|
}
|
|
149
568
|
```
|
|
150
569
|
|
|
570
|
+
## Features
|
|
571
|
+
|
|
572
|
+
- **Flexible Tracking** - Track leads, addresses, or both in any combination
|
|
573
|
+
- **Smart Data Persistence** - Automatically saves and merges data across form steps
|
|
574
|
+
- **Attribution Tracking** - Captures and persists marketing attribution (gclid, fbclid, UTM)
|
|
575
|
+
- **Session Tracking** - Comprehensive browser and user session data
|
|
576
|
+
- **Production Detection** - Domain-based environment detection
|
|
577
|
+
- **TypeScript Support** - Full type definitions for all data structures
|
|
578
|
+
- **Framework Agnostic** - Works with React, Vue, vanilla JS, or any framework
|
|
579
|
+
|
|
151
580
|
## License
|
|
152
581
|
|
|
153
582
|
ISC
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeadTracker.d.ts","sourceRoot":"","sources":["../src/LeadTracker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,OAAO,EACP,WAAW,EACX,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,WAAW,CAAc;gBAErB,MAAM,EAAE,iBAAiB;IAMrC,OAAO,CAAC,cAAc;IAef,YAAY,IAAI,OAAO;IAOjB,mBAAmB,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"LeadTracker.d.ts","sourceRoot":"","sources":["../src/LeadTracker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,OAAO,EACP,WAAW,EACX,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,WAAW,CAAc;gBAErB,MAAM,EAAE,iBAAiB;IAMrC,OAAO,CAAC,cAAc;IAef,YAAY,IAAI,OAAO;IAOjB,mBAAmB,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA4G1G,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,WAAW;IAaZ,cAAc,IAAI,WAAW;IA8DpC,OAAO,CAAC,cAAc;IA6CtB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,qBAAqB;IA0B7B,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,UAAU;CAQnB"}
|
package/dist/LeadTracker.js
CHANGED
|
@@ -28,6 +28,11 @@ class LeadTracker {
|
|
|
28
28
|
console.warn('[Lead Tracker]', errorMessage);
|
|
29
29
|
throw new Error(errorMessage);
|
|
30
30
|
}
|
|
31
|
+
if (address && !address.source) {
|
|
32
|
+
const errorMessage = 'Address source is required when tracking address';
|
|
33
|
+
console.warn('[Lead Tracker]', errorMessage);
|
|
34
|
+
throw new Error(errorMessage);
|
|
35
|
+
}
|
|
31
36
|
const savedLead = this.getSavedLead();
|
|
32
37
|
const savedAddress = this.getSavedAddress();
|
|
33
38
|
let finalLead = null;
|
package/dist/LeadTracker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeadTracker.js","sourceRoot":"","sources":["../src/LeadTracker.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAS5C,MAAa,WAAW;IAItB,YAAY,MAAyB;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,CAAC,EAAE,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACpF,IAAI,CAAC,cAA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