@mparticle/web-amplitude-kit 2.2.0 → 2.3.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/dist/Amplitude.common.js +289 -68
- package/package.json +43 -42
- package/CHANGELOG.md +0 -49
package/dist/Amplitude.common.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
/*!
|
|
4
|
-
* isobject <https://github.com/jonschlinkert/isobject>
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
7
|
-
* Released under the MIT License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
function isObject(val) {
|
|
11
|
-
return val != null && typeof val === 'object' && Array.isArray(val) === false;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
3
|
/* eslint-disable no-undef*/
|
|
15
4
|
//
|
|
16
5
|
// Copyright 2015 mParticle, Inc.
|
|
@@ -27,8 +16,6 @@ function isObject(val) {
|
|
|
27
16
|
// See the License for the specific language governing permissions and
|
|
28
17
|
// limitations under the License.
|
|
29
18
|
|
|
30
|
-
|
|
31
|
-
|
|
32
19
|
var name = 'Amplitude',
|
|
33
20
|
moduleId = 53,
|
|
34
21
|
MessageType = {
|
|
@@ -57,32 +44,48 @@ var constants = {
|
|
|
57
44
|
other10: 'other10',
|
|
58
45
|
};
|
|
59
46
|
|
|
47
|
+
var MP_AMP_SPLIT = 'mparticle_amplitude_should_split',
|
|
48
|
+
TOTAL_AMOUNT = 'Total Amount',
|
|
49
|
+
TOTAL = 'Total',
|
|
50
|
+
PRODUCTS = 'products',
|
|
51
|
+
REFUND = 'Refund',
|
|
52
|
+
PURCHASE = 'Purchase',
|
|
53
|
+
TOTAL_PRODUCT_AMOUNT = 'Total Product Amount';
|
|
54
|
+
|
|
55
|
+
var includeIndividualProductEvents,
|
|
56
|
+
shouldSendSeparateAmplitudeRevenueEvent,
|
|
57
|
+
enableTempAmplitudeEcommerce;
|
|
58
|
+
|
|
60
59
|
/* eslint-disable */
|
|
61
60
|
// prettier-ignore
|
|
62
61
|
var renderSnippet = function() {
|
|
63
|
-
(function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement("script")
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
;function s(e,t){e.prototype[t]=function(){
|
|
62
|
+
(function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement("script");
|
|
63
|
+
r.type="text/javascript";
|
|
64
|
+
r.integrity="sha384-QahB0HKETlcqjneomU3Ohs+UgJTinhUNFIKJitEl2Vo7DjvphO2jei64ZP5J2GA5";
|
|
65
|
+
r.crossOrigin="anonymous";r.async=true;
|
|
66
|
+
r.src="https://cdn.amplitude.com/libs/amplitude-8.21.8-min.gz.js";
|
|
67
|
+
r.onload=function(){if(!e.amplitude.runQueuedFunctions){console.log(
|
|
68
|
+
"[Amplitude] Error: could not load SDK");}};var s=t.getElementsByTagName("script"
|
|
69
|
+
)[0];s.parentNode.insertBefore(r,s);function i(e,t){e.prototype[t]=function(){
|
|
72
70
|
this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));return this};}
|
|
73
|
-
var o=function(){this._q=[];return this}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
;var l=[
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
;e
|
|
71
|
+
var o=function(){this._q=[];return this};var a=["add","append","clearAll",
|
|
72
|
+
"prepend","set","setOnce","unset","preInsert","postInsert","remove"];for(
|
|
73
|
+
var c=0;c<a.length;c++){i(o,a[c]);}n.Identify=o;var l=function(){this._q=[];
|
|
74
|
+
return this};var p=["setProductId","setQuantity","setPrice","setRevenueType",
|
|
75
|
+
"setEventProperties"];for(var u=0;u<p.length;u++){i(l,p[u]);}n.Revenue=l;var d=[
|
|
76
|
+
"init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut",
|
|
77
|
+
"setVersionName","setDomain","setDeviceId","enableTracking",
|
|
78
|
+
"setGlobalUserProperties","identify","clearUserProperties","setGroup",
|
|
79
|
+
"logRevenueV2","regenerateDeviceId","groupIdentify","onInit","onNewSessionStart"
|
|
80
|
+
,"logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId",
|
|
81
|
+
"getDeviceId","getUserId","setMinTimeBetweenSessionsMillis",
|
|
82
|
+
"setEventUploadThreshold","setUseDynamicConfig","setServerZone","setServerUrl",
|
|
83
|
+
"sendEvents","setLibrary","setTransport"];function v(t){function e(e){t[e
|
|
84
|
+
]=function(){t._q.push([e].concat(Array.prototype.slice.call(arguments,0)));};}
|
|
85
|
+
for(var n=0;n<d.length;n++){e(d[n]);}}v(n);n.getInstance=function(e){e=(
|
|
86
|
+
!e||e.length===0?"$default_instance":e).toLowerCase();if(
|
|
87
|
+
!Object.prototype.hasOwnProperty.call(n._iq,e)){n._iq[e]={_q:[]};v(n._iq[e]);}
|
|
88
|
+
return n._iq[e]};e.amplitude=n;})(window,document);
|
|
86
89
|
/* eslint-enable */
|
|
87
90
|
};
|
|
88
91
|
|
|
@@ -341,7 +344,7 @@ var constructor = function () {
|
|
|
341
344
|
function createEcommerceAttributes(attributes) {
|
|
342
345
|
var updatedAttributes = {};
|
|
343
346
|
for (var key in attributes) {
|
|
344
|
-
if (key !==
|
|
347
|
+
if (key !== TOTAL_AMOUNT && key !== TOTAL_PRODUCT_AMOUNT) {
|
|
345
348
|
updatedAttributes[key] = attributes[key];
|
|
346
349
|
}
|
|
347
350
|
}
|
|
@@ -351,62 +354,263 @@ var constructor = function () {
|
|
|
351
354
|
|
|
352
355
|
function logCommerce(event) {
|
|
353
356
|
var expandedEvents = mParticle.eCommerce.expandCommerceEvent(event);
|
|
357
|
+
// if Product Action exists, it's a regular product action commerce event
|
|
354
358
|
if (event.ProductAction) {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
359
|
+
if (enableTempAmplitudeEcommerce) {
|
|
360
|
+
return processTemporaryProductAction(event, expandedEvents);
|
|
361
|
+
} else {
|
|
362
|
+
// TODO: Remove this old code path when Amplitude is ready
|
|
363
|
+
var isRefund, isPurchase, logRevenue;
|
|
364
|
+
isRefund =
|
|
365
|
+
event.ProductAction.ProductActionType ===
|
|
366
|
+
mParticle.ProductActionType.Refund;
|
|
367
|
+
isPurchase =
|
|
368
|
+
event.ProductAction.ProductActionType ===
|
|
369
|
+
mParticle.ProductActionType.Purchase;
|
|
370
|
+
logRevenue = isRefund || isPurchase;
|
|
371
|
+
expandedEvents.forEach(function (expandedEvt) {
|
|
372
|
+
// Exclude Totals from the attributes as we log it in the revenue call
|
|
373
|
+
var updatedAttributes = createEcommerceAttributes(
|
|
374
|
+
expandedEvt.EventAttributes
|
|
375
|
+
);
|
|
376
|
+
|
|
377
|
+
// Purchase and Refund events generate an additional 'Total' event
|
|
378
|
+
if (
|
|
379
|
+
logRevenue &&
|
|
380
|
+
expandedEvt.EventName.indexOf('Total') > -1
|
|
381
|
+
) {
|
|
382
|
+
var revenueAmount =
|
|
383
|
+
(expandedEvt.EventAttributes['Total Amount'] || 0) *
|
|
384
|
+
(isRefund ? -1 : 1);
|
|
385
|
+
var revenue = new window.amplitude.Revenue()
|
|
386
|
+
.setPrice(revenueAmount)
|
|
387
|
+
.setEventProperties(updatedAttributes);
|
|
388
|
+
getInstance().logRevenueV2(revenue);
|
|
389
|
+
} else {
|
|
390
|
+
getInstance().logEvent(
|
|
391
|
+
expandedEvt.EventName,
|
|
392
|
+
updatedAttributes
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// if it is not a product action, it is an impression or promotion commerce event
|
|
402
|
+
if (isNotProductAction(event)) {
|
|
363
403
|
expandedEvents.forEach(function (expandedEvt) {
|
|
364
404
|
// Exclude Totals from the attributes as we log it in the revenue call
|
|
365
405
|
var updatedAttributes = createEcommerceAttributes(
|
|
366
406
|
expandedEvt.EventAttributes
|
|
367
407
|
);
|
|
368
408
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
(isRefund ? -1 : 1);
|
|
374
|
-
var revenue = new window.amplitude.Revenue()
|
|
375
|
-
.setPrice(revenueAmount)
|
|
376
|
-
.setEventProperties(updatedAttributes);
|
|
377
|
-
getInstance().logRevenueV2(revenue);
|
|
378
|
-
} else {
|
|
379
|
-
getInstance().logEvent(
|
|
380
|
-
expandedEvt.EventName,
|
|
381
|
-
updatedAttributes
|
|
382
|
-
);
|
|
383
|
-
}
|
|
409
|
+
getInstance().logEvent(
|
|
410
|
+
expandedEvt.EventName,
|
|
411
|
+
updatedAttributes
|
|
412
|
+
);
|
|
384
413
|
});
|
|
385
414
|
|
|
386
415
|
return true;
|
|
387
416
|
}
|
|
388
417
|
|
|
418
|
+
console.warn(
|
|
419
|
+
'Commerce event does not conform to our expectations and was not forwarded to Amplitude. Please double-check your code.'
|
|
420
|
+
);
|
|
421
|
+
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/*
|
|
426
|
+
When we process a product action event, Amplitude has a very specific way of
|
|
427
|
+
sending events to them:
|
|
428
|
+
|
|
429
|
+
1. Send a summary event with event attributes from the MP event.
|
|
430
|
+
a. Add a key of `products` with a value of JSON.stringify(productArray).
|
|
431
|
+
b. Add a key of mparticle_amplitude_should_split with a value of `false`.
|
|
432
|
+
|
|
433
|
+
2. Determine if we send product level events or not.
|
|
434
|
+
a. If includeIndividualProductEvents === true, send product level events
|
|
435
|
+
b. If includeIndividualProductEvents === false, do not send product level events
|
|
436
|
+
|
|
437
|
+
3. Determine if we send an Amplitude revenue event or not.
|
|
438
|
+
a. If shouldSendSeparateAmplitudeRevenueEvent === true, send an Amplitude revenue event.
|
|
439
|
+
b. If shouldSendSeparateAmplitudeRevenueEvent === true, the summary event attribute should be `revenue`.
|
|
440
|
+
c. If shouldSendSeparateAmplitudeRevenueEvent === false, the summary event attribute should be `$revenue`
|
|
441
|
+
|
|
442
|
+
See test/AmplitudeCommerceEvent.MD for examples of what the expectations of the payload are.
|
|
443
|
+
|
|
444
|
+
*/
|
|
445
|
+
function processTemporaryProductAction(
|
|
446
|
+
unexpandedCommerceEvent,
|
|
447
|
+
expandedEvents
|
|
448
|
+
) {
|
|
449
|
+
var summaryEvent, isRefund, isPurchase, isMPRevenueEvent;
|
|
450
|
+
|
|
451
|
+
isRefund =
|
|
452
|
+
unexpandedCommerceEvent.ProductAction.ProductActionType ===
|
|
453
|
+
mParticle.ProductActionType.Refund;
|
|
454
|
+
isPurchase =
|
|
455
|
+
unexpandedCommerceEvent.ProductAction.ProductActionType ===
|
|
456
|
+
mParticle.ProductActionType.Purchase;
|
|
457
|
+
isMPRevenueEvent = isRefund || isPurchase;
|
|
458
|
+
|
|
459
|
+
// if the event is a revenue event, then we set it to the expanded `Total` event for backwards compatibility
|
|
389
460
|
if (
|
|
461
|
+
isMPRevenueEvent &&
|
|
462
|
+
expandedEvents[0].EventName.indexOf(TOTAL) > -1
|
|
463
|
+
) {
|
|
464
|
+
summaryEvent = expandedEvents[0];
|
|
465
|
+
sendMPRevenueSummaryEvent(
|
|
466
|
+
summaryEvent,
|
|
467
|
+
unexpandedCommerceEvent.ProductAction.ProductList,
|
|
468
|
+
isRefund,
|
|
469
|
+
shouldSendSeparateAmplitudeRevenueEvent
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if (!isMPRevenueEvent) {
|
|
474
|
+
sendSummaryEvent(unexpandedCommerceEvent);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if (includeIndividualProductEvents) {
|
|
478
|
+
sendIndividualProductEvents(
|
|
479
|
+
expandedEvents,
|
|
480
|
+
isMPRevenueEvent,
|
|
481
|
+
shouldSendSeparateAmplitudeRevenueEvent,
|
|
482
|
+
isRefund
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return true;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// If event.ProductAction does not exist, the commerce event is a promotion or impression event
|
|
490
|
+
function isNotProductAction(event) {
|
|
491
|
+
return (
|
|
390
492
|
event.EventCategory ===
|
|
391
493
|
mParticle.CommerceEventType.ProductImpression ||
|
|
392
494
|
event.EventCategory === mParticle.CommerceEventType.PromotionView ||
|
|
393
495
|
event.EventCategory === mParticle.CommerceEventType.PromotionClick
|
|
394
|
-
)
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// this function does not use Amplitude's logRevenueV2, but rather sends custom event names
|
|
500
|
+
function sendMPRevenueSummaryEvent(
|
|
501
|
+
summaryEvent,
|
|
502
|
+
products,
|
|
503
|
+
isRefund,
|
|
504
|
+
shouldSendSeparateAmplitudeRevenueEvent
|
|
505
|
+
) {
|
|
506
|
+
// send the ecommerce - purchase event
|
|
507
|
+
var updatedAttributes = createMPRevenueEcommerceAttributes(
|
|
508
|
+
summaryEvent.EventAttributes,
|
|
509
|
+
shouldSendSeparateAmplitudeRevenueEvent,
|
|
510
|
+
isRefund
|
|
511
|
+
);
|
|
512
|
+
updatedAttributes[MP_AMP_SPLIT] = false;
|
|
513
|
+
|
|
514
|
+
updatedAttributes[PRODUCTS] = products;
|
|
515
|
+
var revenueEventLabel = isRefund ? REFUND : PURCHASE;
|
|
516
|
+
getInstance().logEvent(
|
|
517
|
+
'eCommerce - ' + revenueEventLabel,
|
|
518
|
+
updatedAttributes
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// revenue summary event will either have $price/price or $revenue/revenue depending on if
|
|
523
|
+
function createMPRevenueEcommerceAttributes(
|
|
524
|
+
attributes,
|
|
525
|
+
shouldSendSeparateAmplitudeRevenueEvent,
|
|
526
|
+
isRefund
|
|
527
|
+
) {
|
|
528
|
+
var updatedAttributes = {};
|
|
529
|
+
for (var key in attributes) {
|
|
530
|
+
if (key === TOTAL_AMOUNT) {
|
|
531
|
+
// A purchase is a positive amount and a refund is negative
|
|
532
|
+
var revenueAmount = attributes[key] * (isRefund ? -1 : 1);
|
|
533
|
+
// If we send a separate Amplitude Revenue Event, Amplitude's
|
|
534
|
+
// SDK prefixes price/revenue with a $ for calculating things
|
|
535
|
+
// like LTV, so we do not want to prepend it as part of the
|
|
536
|
+
// summary event to avoid double counting
|
|
537
|
+
var revenueKey = shouldSendSeparateAmplitudeRevenueEvent
|
|
538
|
+
? 'revenue'
|
|
539
|
+
: '$revenue';
|
|
540
|
+
|
|
541
|
+
updatedAttributes[revenueKey] = revenueAmount;
|
|
542
|
+
} else if (key !== TOTAL_AMOUNT) {
|
|
543
|
+
updatedAttributes[key] = attributes[key];
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
return convertJsonAttrs(updatedAttributes);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
function createAttrsForAmplitudeRevenueEvent(attributes) {
|
|
551
|
+
var updatedAttributes = {};
|
|
552
|
+
for (var key in attributes) {
|
|
553
|
+
if (key !== TOTAL_AMOUNT) {
|
|
554
|
+
updatedAttributes[key] = attributes[key];
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
return convertJsonAttrs(updatedAttributes);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
function sendSummaryEvent(summaryEvent) {
|
|
562
|
+
var updatedAttributes = createEcommerceAttributes(
|
|
563
|
+
summaryEvent.EventAttributes
|
|
564
|
+
);
|
|
565
|
+
updatedAttributes[MP_AMP_SPLIT] = false;
|
|
566
|
+
try {
|
|
567
|
+
updatedAttributes[PRODUCTS] =
|
|
568
|
+
summaryEvent.ProductAction.ProductList;
|
|
569
|
+
} catch (e) {
|
|
570
|
+
console.error('error adding Product List to summary event');
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
getInstance().logEvent(summaryEvent.EventName, updatedAttributes);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
function sendIndividualProductEvents(
|
|
577
|
+
expandedEvents,
|
|
578
|
+
isMPRevenueEvent,
|
|
579
|
+
shouldSendSeparateAmplitudeRevenueEvent,
|
|
580
|
+
isRefund
|
|
581
|
+
) {
|
|
582
|
+
expandedEvents.forEach(function (expandedEvt) {
|
|
583
|
+
var updatedAttributes;
|
|
584
|
+
// `Total` exists on an expanded event if it is part of a revenue/purchase event
|
|
585
|
+
// but not on other commerce events. This only needs to be fired if shouldSendSeparateAmplitudeRevenueEvent === True
|
|
586
|
+
if (
|
|
587
|
+
isMPRevenueEvent &&
|
|
588
|
+
// A purchase is a positive amount and a refund is negative
|
|
589
|
+
(expandedEvt.EventName.indexOf(TOTAL) > -1) &
|
|
590
|
+
shouldSendSeparateAmplitudeRevenueEvent
|
|
591
|
+
) {
|
|
592
|
+
var revenueAmount =
|
|
593
|
+
// A purchase is a positive amount and a refund is negative
|
|
594
|
+
(expandedEvt.EventAttributes[TOTAL_AMOUNT] || 0) *
|
|
595
|
+
(isRefund ? -1 : 1);
|
|
596
|
+
updatedAttributes = createAttrsForAmplitudeRevenueEvent(
|
|
398
597
|
expandedEvt.EventAttributes
|
|
399
598
|
);
|
|
400
599
|
|
|
600
|
+
var revenue = new window.amplitude.Revenue()
|
|
601
|
+
.setPrice(revenueAmount)
|
|
602
|
+
.setEventProperties(updatedAttributes);
|
|
603
|
+
getInstance().logRevenueV2(revenue);
|
|
604
|
+
} else if (expandedEvt.EventName.indexOf(TOTAL) === -1) {
|
|
605
|
+
updatedAttributes = createEcommerceAttributes(
|
|
606
|
+
expandedEvt.EventAttributes
|
|
607
|
+
);
|
|
401
608
|
getInstance().logEvent(
|
|
402
609
|
expandedEvt.EventName,
|
|
403
610
|
updatedAttributes
|
|
404
611
|
);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
return false;
|
|
612
|
+
}
|
|
613
|
+
});
|
|
410
614
|
}
|
|
411
615
|
|
|
412
616
|
function convertJsonAttrs(customAttributes) {
|
|
@@ -434,6 +638,15 @@ var constructor = function () {
|
|
|
434
638
|
forwarderSettings = settings;
|
|
435
639
|
reportingService = service;
|
|
436
640
|
|
|
641
|
+
// Changing this setting from a negative action to a positive action for readability
|
|
642
|
+
includeIndividualProductEvents =
|
|
643
|
+
forwarderSettings.excludeIndividualProductEvents === 'False';
|
|
644
|
+
// Only send separate amplitude revenue events when we includeIndividualProductEvents,
|
|
645
|
+
// so create this variable for clarity
|
|
646
|
+
shouldSendSeparateAmplitudeRevenueEvent = includeIndividualProductEvents;
|
|
647
|
+
|
|
648
|
+
enableTempAmplitudeEcommerce =
|
|
649
|
+
forwarderSettings.enableTempAmplitudeEcommerce === 'True';
|
|
437
650
|
try {
|
|
438
651
|
if (!window.amplitude) {
|
|
439
652
|
if (testMode !== true) {
|
|
@@ -525,6 +738,14 @@ function getId() {
|
|
|
525
738
|
return moduleId;
|
|
526
739
|
}
|
|
527
740
|
|
|
741
|
+
function isObject(val) {
|
|
742
|
+
return (
|
|
743
|
+
val != null &&
|
|
744
|
+
typeof val === 'object' &&
|
|
745
|
+
Array.isArray(val) === false
|
|
746
|
+
);
|
|
747
|
+
}
|
|
748
|
+
|
|
528
749
|
function register(config) {
|
|
529
750
|
if (!config) {
|
|
530
751
|
console.log(
|
package/package.json
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
2
|
+
"name": "@mparticle/web-amplitude-kit",
|
|
3
|
+
"version": "2.3.0",
|
|
4
|
+
"author": "mParticle Developers <developers@mparticle.com> (https://www.mparticle.com)",
|
|
5
|
+
"description": "mParticle integration sdk for Amplitude",
|
|
6
|
+
"main": "dist/Amplitude.common.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist/Amplitude.common.js"
|
|
9
|
+
],
|
|
10
|
+
"repository": "https://github.com/mparticle-integrations/mparticle-javascript-integration-amplitude",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "rollup --config rollup.config.js",
|
|
13
|
+
"build:test": "rollup --config rollup.test.config.js",
|
|
14
|
+
"test": "npm run build && npm run build:test && DEBUG=false karma start test/karma.config.js",
|
|
15
|
+
"test:debug": "npm run build && npm run build:test && DEBUG=true karma start test/karma.config.js",
|
|
16
|
+
"watch": "rollup --config rollup.config.js -w"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@mparticle/web-sdk": "^2.12.8",
|
|
20
|
+
"@semantic-release/changelog": "^5.0.1",
|
|
21
|
+
"@semantic-release/exec": "^5.0.0",
|
|
22
|
+
"@semantic-release/git": "^9.0.0",
|
|
23
|
+
"chai": "^4.2.0",
|
|
24
|
+
"eslint-config-prettier": "6.3.0",
|
|
25
|
+
"eslint-plugin-prettier": "3.1.1",
|
|
26
|
+
"karma": "^5.0.9",
|
|
27
|
+
"karma-chai": "^0.1.0",
|
|
28
|
+
"karma-chrome-launcher": "^2.2.0",
|
|
29
|
+
"karma-edge-launcher": "^0.4.2",
|
|
30
|
+
"karma-firefox-launcher": "^1.1.0",
|
|
31
|
+
"karma-ie-launcher": "^1.0.0",
|
|
32
|
+
"karma-junit-reporter": "^1.2.0",
|
|
33
|
+
"karma-mocha": "^1.3.0",
|
|
34
|
+
"karma-safari-launcher": "^1.0.0",
|
|
35
|
+
"mocha": "^2.3.2",
|
|
36
|
+
"prettier": "^2.2.1",
|
|
37
|
+
"rollup": "^1.13.1",
|
|
38
|
+
"rollup-plugin-commonjs": "^10.0.0",
|
|
39
|
+
"rollup-plugin-node-resolve": "^5.0.1",
|
|
40
|
+
"shelljs": "^0.8.4",
|
|
41
|
+
"should": "^7.1.1",
|
|
42
|
+
"watchify": "^3.11.1"
|
|
43
|
+
},
|
|
44
|
+
"license": "Apache-2.0"
|
|
44
45
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
## Releases
|
|
2
|
-
|
|
3
|
-
--
|
|
4
|
-
#### 2.2.0 - 2021-11-03
|
|
5
|
-
|
|
6
|
-
- feat: Support other5-other10 IDs
|
|
7
|
-
|
|
8
|
-
#### 2.1.0 - 2021-08-30
|
|
9
|
-
|
|
10
|
-
- feat: Add support for EU Data Center
|
|
11
|
-
|
|
12
|
-
#### 2.0.8 - 2021-05-26
|
|
13
|
-
|
|
14
|
-
- Generate bundle that was not included in 2.0.7 release
|
|
15
|
-
|
|
16
|
-
#### 2.0.7 - 2021-05-26
|
|
17
|
-
|
|
18
|
-
- fix: Map impression and promotion events to align with server
|
|
19
|
-
|
|
20
|
-
#### 2.0.6 - 2021-04-06
|
|
21
|
-
|
|
22
|
-
- feat: Add includeEmailAsUserProperty and no longer set userIdentities as user properties to align with server
|
|
23
|
-
|
|
24
|
-
- Previously the web kit set non-customerid user identities as user properties. This was not consistent with the server, and so this functionality has been removed from web SDK v2.
|
|
25
|
-
|
|
26
|
-
- build: Update eslint/prettier config, fix linting errors
|
|
27
|
-
|
|
28
|
-
#### 2.0.5 - 2021-01-11
|
|
29
|
-
|
|
30
|
-
- Update Amplitude SDK to 7.2.1
|
|
31
|
-
- Bugfix - Check window for node environments
|
|
32
|
-
- Remove build file from root directory
|
|
33
|
-
|
|
34
|
-
#### 2.0.4 - 2020-11-04
|
|
35
|
-
|
|
36
|
-
- Bugfix - remove isTesting variable
|
|
37
|
-
|
|
38
|
-
#### 2.0.3 - 2020-06-30
|
|
39
|
-
|
|
40
|
-
- Feat: Support sending objects as custom attributes to Amplitude
|
|
41
|
-
|
|
42
|
-
#### 2.0.2 - 2020-06-03
|
|
43
|
-
|
|
44
|
-
- Update Amplitude SDK version to 6.2.0
|
|
45
|
-
- Update test configuration
|
|
46
|
-
|
|
47
|
-
#### 2.0.1 - 2020-02-03
|
|
48
|
-
|
|
49
|
-
- Modify rollup settings - build dist files
|