@segment/action-destinations 3.134.0 → 3.134.1-staging.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/dist/destinations/actable-predictive/index.js +1 -1
- package/dist/destinations/actable-predictive/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendCustomEvent/index.js +13 -13
- package/dist/destinations/actable-predictive/sendCustomEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendEmailEvent/index.js +20 -20
- package/dist/destinations/actable-predictive/sendEmailEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendTransactionEvent/index.js +28 -28
- package/dist/destinations/actable-predictive/sendTransactionEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendWebEvent/index.js +25 -25
- package/dist/destinations/actable-predictive/sendWebEvent/index.js.map +1 -1
- package/dist/destinations/actions-bingads/functions.d.ts +0 -0
- package/dist/destinations/actions-bingads/functions.js +2 -0
- package/dist/destinations/actions-bingads/functions.js.map +1 -0
- package/dist/destinations/actions-bingads/generated-types.d.ts +10 -0
- package/dist/destinations/actions-bingads/generated-types.js +3 -0
- package/dist/destinations/actions-bingads/generated-types.js.map +1 -0
- package/dist/destinations/actions-bingads/index.d.ts +4 -0
- package/dist/destinations/actions-bingads/index.js +77 -0
- package/dist/destinations/actions-bingads/index.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.d.ts +8 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.js +33 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.d.ts +7 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.js +3 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.d.ts +5 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.js +131 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.js.map +1 -0
- package/dist/destinations/braze/trackEvent/generated-types.d.ts +0 -1
- package/dist/destinations/braze/trackEvent/index.js +35 -11
- package/dist/destinations/braze/trackEvent/index.js.map +1 -1
- package/dist/destinations/braze/trackPurchase/index.js +43 -2
- package/dist/destinations/braze/trackPurchase/index.js.map +1 -1
- package/dist/destinations/braze-cohorts/cohortChanges.d.ts +10 -0
- package/dist/destinations/braze-cohorts/cohortChanges.js +3 -0
- package/dist/destinations/braze-cohorts/cohortChanges.js.map +1 -0
- package/dist/destinations/clevertap/userDelete/index.js +4 -4
- package/dist/destinations/clevertap/userDelete/index.js.map +1 -1
- package/dist/destinations/cordial/addContactToList/index.js.map +1 -1
- package/dist/destinations/cordial/addProductToCart/index.js +1 -1
- package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
- package/dist/destinations/cordial/cordial-client.js +2 -2
- package/dist/destinations/cordial/createContactactivity/index.js.map +1 -1
- package/dist/destinations/cordial/identities-fields.d.ts +1 -1
- package/dist/destinations/cordial/identities-fields.js +1 -1
- package/dist/destinations/cordial/identities-fields.js.map +1 -1
- package/dist/destinations/cordial/index.js +1 -1
- package/dist/destinations/cordial/index.js.map +1 -1
- package/dist/destinations/cordial/mergeContacts/index.js.map +1 -1
- package/dist/destinations/cordial/removeContactFromList/index.js.map +1 -1
- package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
- package/dist/destinations/cordial/upsertOrder/index.js +8 -8
- package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js +1 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +1 -1
- package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +6 -10
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToCart/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/addToCart/index.js +6 -10
- package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToWishlist/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/addToWishlist/index.js +6 -10
- package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/beginCheckout/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/beginCheckout/index.js +6 -10
- package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/customEvent/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/customEvent/index.js +6 -10
- package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-functions.d.ts +0 -7
- package/dist/destinations/google-analytics-4/ga4-functions.js +1 -38
- package/dist/destinations/google-analytics-4/ga4-functions.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-properties.d.ts +0 -2
- package/dist/destinations/google-analytics-4/ga4-properties.js +3 -17
- package/dist/destinations/google-analytics-4/ga4-properties.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-types.d.ts +0 -14
- package/dist/destinations/google-analytics-4/ga4-types.js +0 -6
- package/dist/destinations/google-analytics-4/ga4-types.js.map +1 -1
- package/dist/destinations/google-analytics-4/generateLead/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/generateLead/index.js +6 -10
- package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/generated-types.d.ts +1 -2
- package/dist/destinations/google-analytics-4/index.js +10 -15
- package/dist/destinations/google-analytics-4/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/login/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/login/index.js +6 -10
- package/dist/destinations/google-analytics-4/login/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/pageView/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/pageView/index.js +6 -10
- package/dist/destinations/google-analytics-4/pageView/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/purchase/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/purchase/index.js +6 -10
- package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/refund/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/refund/index.js +6 -10
- package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/removeFromCart/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/removeFromCart/index.js +6 -10
- package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/search/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/search/index.js +6 -10
- package/dist/destinations/google-analytics-4/search/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectItem/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/selectItem/index.js +6 -10
- package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectPromotion/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/selectPromotion/index.js +6 -10
- package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/signUp/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/signUp/index.js +6 -10
- package/dist/destinations/google-analytics-4/signUp/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewCart/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/viewCart/index.js +6 -10
- package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItem/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/viewItem/index.js +6 -10
- package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItemList/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/viewItemList/index.js +6 -10
- package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewPromotion/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/viewPromotion/index.js +6 -10
- package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
- package/dist/destinations/google-sheets-dev/index.js +10 -3
- package/dist/destinations/google-sheets-dev/index.js.map +1 -1
- package/dist/destinations/google-sheets-partner/constants.d.ts +3 -0
- package/dist/destinations/google-sheets-partner/constants.js +7 -0
- package/dist/destinations/google-sheets-partner/constants.js.map +1 -0
- package/dist/destinations/google-sheets-partner/generated-types.d.ts +2 -0
- package/dist/destinations/google-sheets-partner/generated-types.js +3 -0
- package/dist/destinations/google-sheets-partner/generated-types.js.map +1 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.d.ts +17 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.js +34 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/index.d.ts +4 -0
- package/dist/destinations/google-sheets-partner/index.js +43 -0
- package/dist/destinations/google-sheets-partner/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.d.ts +11 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.js +3 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.d.ts +5 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.js +79 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.d.ts +10 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.js +96 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.js.map +1 -0
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/mixpanel/index.js +1 -1
- package/dist/destinations/mixpanel/mixpanel-properties.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/functions.js +1 -1
- package/dist/destinations/mixpanel/trackEvent/functions.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
- package/dist/destinations/mixpanel/trackPurchase/index.js.map +1 -1
- package/dist/destinations/salesforce/sf-properties.d.ts +1 -0
- package/dist/destinations/salesforce/sf-properties.js.map +1 -1
- package/dist/destinations/segment/segment-properties.js +1 -2
- package/dist/destinations/segment/segment-properties.js.map +1 -1
- package/dist/destinations/segment/sendTrack/generated-types.d.ts +1 -1
- package/dist/destinations/tiktok-audiences/addUser/generated-types.d.ts +12 -0
- package/dist/destinations/tiktok-audiences/addUser/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/addUser/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/addUser/index.d.ts +5 -0
- package/dist/destinations/tiktok-audiences/addUser/index.js +47 -0
- package/dist/destinations/tiktok-audiences/addUser/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/api/api.test.d.ts +1 -0
- package/dist/destinations/tiktok-audiences/api/api.test.js +118 -0
- package/dist/destinations/tiktok-audiences/api/api.test.js.map +1 -0
- package/dist/destinations/tiktok-audiences/api/index.d.ts +13 -0
- package/dist/destinations/tiktok-audiences/api/index.js +93 -0
- package/dist/destinations/tiktok-audiences/api/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/constants.d.ts +2 -0
- package/dist/destinations/tiktok-audiences/constants.js +6 -0
- package/dist/destinations/tiktok-audiences/constants.js.map +1 -0
- package/dist/destinations/tiktok-audiences/functions.d.ts +14 -0
- package/dist/destinations/tiktok-audiences/functions.js +116 -0
- package/dist/destinations/tiktok-audiences/functions.js.map +1 -0
- package/dist/destinations/tiktok-audiences/generated-types.d.ts +3 -0
- package/dist/destinations/tiktok-audiences/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/index.d.ts +4 -0
- package/dist/destinations/tiktok-audiences/index.js +38 -0
- package/dist/destinations/tiktok-audiences/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/properties.d.ts +11 -0
- package/dist/destinations/tiktok-audiences/properties.js +80 -0
- package/dist/destinations/tiktok-audiences/properties.js.map +1 -0
- package/dist/destinations/tiktok-audiences/removeUser/generated-types.d.ts +12 -0
- package/dist/destinations/tiktok-audiences/removeUser/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/removeUser/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/removeUser/index.d.ts +5 -0
- package/dist/destinations/tiktok-audiences/removeUser/index.js +47 -0
- package/dist/destinations/tiktok-audiences/removeUser/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/types.d.ts +33 -0
- package/dist/destinations/tiktok-audiences/types.js +3 -0
- package/dist/destinations/tiktok-audiences/types.js.map +1 -0
- package/package.json +2 -3
- package/dist/destinations/braze/utils.d.ts +0 -6
- package/dist/destinations/braze/utils.js +0 -81
- package/dist/destinations/braze/utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/generateLead/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/generateLead/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAGlG,sDAU0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,kEAAkE;IAC/E,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EAAE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B,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -22,7 +22,6 @@ const addToWishlist_1 = __importDefault(require("./addToWishlist"));
|
|
|
22
22
|
const addPaymentInfo_1 = __importDefault(require("./addPaymentInfo"));
|
|
23
23
|
const refund_1 = __importDefault(require("./refund"));
|
|
24
24
|
const removeFromCart_1 = __importDefault(require("./removeFromCart"));
|
|
25
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
26
25
|
const destination = {
|
|
27
26
|
name: 'Actions Google Analytic 4',
|
|
28
27
|
slug: 'actions-google-analytics-4',
|
|
@@ -32,15 +31,9 @@ const destination = {
|
|
|
32
31
|
fields: {
|
|
33
32
|
measurementId: {
|
|
34
33
|
label: 'Measurement ID',
|
|
35
|
-
description: 'The
|
|
34
|
+
description: 'The measurement ID associated with a stream. Found in the Google Analytics UI under: Admin > Data Streams > choose your stream > Measurement ID',
|
|
36
35
|
type: 'string',
|
|
37
|
-
required:
|
|
38
|
-
},
|
|
39
|
-
firebaseAppId: {
|
|
40
|
-
label: 'Firebase App ID',
|
|
41
|
-
description: 'The Firebase App ID associated with the Firebase app. Found in the Firebase console under: Project Settings > General > Your Apps > App ID. **Required for mobile app streams.**',
|
|
42
|
-
type: 'string',
|
|
43
|
-
required: false
|
|
36
|
+
required: true
|
|
44
37
|
},
|
|
45
38
|
apiSecret: {
|
|
46
39
|
label: 'API Secret',
|
|
@@ -48,14 +41,16 @@ const destination = {
|
|
|
48
41
|
type: 'string',
|
|
49
42
|
required: true
|
|
50
43
|
}
|
|
51
|
-
},
|
|
52
|
-
testAuthentication(_, { settings }) {
|
|
53
|
-
if (!settings.firebaseAppId && !settings.measurementId) {
|
|
54
|
-
throw new actions_core_1.IntegrationError('One of Firebase App ID (Mobile app Stream) or Measurement ID (Web Stream) is required', 'Misconfigured field', 400);
|
|
55
|
-
}
|
|
56
|
-
return {};
|
|
57
44
|
}
|
|
58
45
|
},
|
|
46
|
+
extendRequest({ settings }) {
|
|
47
|
+
return {
|
|
48
|
+
searchParams: {
|
|
49
|
+
measurement_id: settings.measurementId,
|
|
50
|
+
api_secret: settings.apiSecret
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
},
|
|
59
54
|
actions: {
|
|
60
55
|
purchase: purchase_1.default,
|
|
61
56
|
addToCart: addToCart_1.default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/google-analytics-4/index.ts"],"names":[],"mappings":";;;;;AAEA,0DAAiC;AACjC,4DAAmC;AACnC,0DAAiC;AACjC,gEAAuC;AACvC,8DAAqC;AACrC,oEAA2C;AAC3C,wEAA+C;AAC/C,0DAAiC;AACjC,sDAA6B;AAC7B,kEAAyC;AACzC,sDAA6B;AAC7B,oEAA2C;AAC3C,0DAAiC;AACjC,oDAA2B;AAC3B,kEAAyC;AACzC,oEAA2C;AAC3C,sEAA6C;AAC7C,sDAA6B;AAC7B,sEAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/google-analytics-4/index.ts"],"names":[],"mappings":";;;;;AAEA,0DAAiC;AACjC,4DAAmC;AACnC,0DAAiC;AACjC,gEAAuC;AACvC,8DAAqC;AACrC,oEAA2C;AAC3C,wEAA+C;AAC/C,0DAAiC;AACjC,sDAA6B;AAC7B,kEAAyC;AACzC,sDAA6B;AAC7B,oEAA2C;AAC3C,0DAAiC;AACjC,oDAA2B;AAC3B,kEAAyC;AACzC,oEAA2C;AAC3C,sEAA6C;AAC7C,sDAA6B;AAC7B,sEAA6C;AAE7C,MAAM,WAAW,GAAoC;IAGnD,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,aAAa,EAAE;gBACb,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EACT,iJAAiJ;gBACnJ,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,YAAY;gBACnB,WAAW,EACT,4IAA4I;gBAC9I,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,YAAY,EAAE;gBACZ,cAAc,EAAE,QAAQ,CAAC,aAAa;gBACtC,UAAU,EAAE,QAAQ,CAAC,SAAS;aAC/B;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,QAAQ,EAAR,kBAAQ;QACR,SAAS,EAAT,mBAAS;QACT,QAAQ,EAAR,kBAAQ;QACR,WAAW,EAAX,qBAAW;QACX,UAAU,EAAV,oBAAU;QACV,aAAa,EAAb,uBAAa;QACb,eAAe,EAAf,yBAAe;QACf,QAAQ,EAAR,kBAAQ;QACR,cAAc,EAAd,wBAAc;QACd,QAAQ,EAAR,kBAAQ;QACR,MAAM,EAAN,gBAAM;QACN,YAAY,EAAZ,sBAAY;QACZ,MAAM,EAAN,gBAAM;QACN,aAAa,EAAb,uBAAa;QACb,cAAc,EAAd,wBAAc;QACd,MAAM,EAAN,gBAAM;QACN,KAAK,EAAL,eAAK;QACL,YAAY,EAAZ,sBAAY;QACZ,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ga4_functions_1 = require("../ga4-functions");
|
|
4
4
|
const ga4_properties_1 = require("../ga4-properties");
|
|
5
|
-
const ga4_types_1 = require("../ga4-types");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Login',
|
|
8
7
|
description: 'Send event when a user logs in',
|
|
9
8
|
defaultSubscription: 'type = "track" and event = "Signed In"',
|
|
10
9
|
fields: {
|
|
11
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
12
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
13
10
|
client_id: { ...ga4_properties_1.client_id },
|
|
14
11
|
user_id: { ...ga4_properties_1.user_id },
|
|
15
12
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -22,17 +19,13 @@ const action = {
|
|
|
22
19
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
23
20
|
params: ga4_properties_1.params
|
|
24
21
|
},
|
|
25
|
-
perform: (request, { payload, features
|
|
26
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
27
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
28
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
29
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
22
|
+
perform: (request, { payload, features }) => {
|
|
30
23
|
if (features && features['actions-google-analytics-4-verify-params-feature']) {
|
|
31
24
|
ga4_functions_1.verifyParams(payload.params);
|
|
32
25
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
33
26
|
}
|
|
34
27
|
const request_object = {
|
|
35
|
-
|
|
28
|
+
client_id: payload.client_id,
|
|
36
29
|
user_id: payload.user_id,
|
|
37
30
|
events: [
|
|
38
31
|
{
|
|
@@ -49,7 +42,10 @@ const action = {
|
|
|
49
42
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
50
43
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
51
44
|
}
|
|
52
|
-
return
|
|
45
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
46
|
+
method: 'POST',
|
|
47
|
+
json: request_object
|
|
48
|
+
});
|
|
53
49
|
}
|
|
54
50
|
};
|
|
55
51
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/login/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/login/index.ts"],"names":[],"mappings":";;AAGA,oDAAkF;AAClF,sDAQ0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,gCAAgC;IAC7C,mBAAmB,EAAE,wCAAwC;IAC7D,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2BAA2B;SACzC;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IAED,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,QAAQ,IAAI,QAAQ,CAAC,kDAAkD,CAAC,EAAE;YAC5E,4BAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAC5B,+BAAe,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;SACzC;QAED,MAAM,cAAc,GAA2B;YAC7C,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE;wBACN,MAAM,EAAE,OAAO,CAAC,MAAM;wBACtB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;wBAClD,GAAG,OAAO,CAAC,MAAM;qBAClB;iBACF;aACF;YACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;SACjD,CAAA;QAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,0CAA0C,CAAC,EAAE;YACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ga4_functions_1 = require("../ga4-functions");
|
|
4
4
|
const ga4_properties_1 = require("../ga4-properties");
|
|
5
|
-
const ga4_types_1 = require("../ga4-types");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Page View',
|
|
8
7
|
description: 'Send page view when a user views a page',
|
|
9
8
|
defaultSubscription: 'type = "page"',
|
|
10
9
|
fields: {
|
|
11
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
12
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
13
10
|
clientId: { ...ga4_properties_1.client_id },
|
|
14
11
|
user_id: { ...ga4_properties_1.user_id },
|
|
15
12
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -41,17 +38,13 @@ const action = {
|
|
|
41
38
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
42
39
|
params: ga4_properties_1.params
|
|
43
40
|
},
|
|
44
|
-
perform: (request, { payload, features
|
|
45
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
46
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
47
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
48
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.clientId);
|
|
41
|
+
perform: (request, { payload, features }) => {
|
|
49
42
|
if (features && features['actions-google-analytics-4-verify-params-feature']) {
|
|
50
43
|
ga4_functions_1.verifyParams(payload.params);
|
|
51
44
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
52
45
|
}
|
|
53
46
|
const request_object = {
|
|
54
|
-
|
|
47
|
+
client_id: payload.clientId,
|
|
55
48
|
user_id: payload.user_id,
|
|
56
49
|
events: [
|
|
57
50
|
{
|
|
@@ -70,7 +63,10 @@ const action = {
|
|
|
70
63
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
71
64
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
72
65
|
}
|
|
73
|
-
return
|
|
66
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
67
|
+
method: 'POST',
|
|
68
|
+
json: request_object
|
|
69
|
+
});
|
|
74
70
|
}
|
|
75
71
|
};
|
|
76
72
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/pageView/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/pageView/index.ts"],"names":[],"mappings":";;AAGA,oDAAkF;AAClF,sDAQ0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,yCAAyC;IACtD,mBAAmB,EAAE,eAAe;IACpC,MAAM,EAAE;QACN,QAAQ,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC1B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,sBAAsB;YACnC,OAAO,EAAE;gBACP,OAAO,EAAE,oBAAoB;aAC9B;SACF;QACD,aAAa,E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AM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
|
-
const ga4_types_1 = require("../ga4-types");
|
|
6
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
7
6
|
const action = {
|
|
8
7
|
title: 'Purchase',
|
|
9
8
|
description: 'Send event when a user completes a purchase',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Order Completed"',
|
|
11
10
|
fields: {
|
|
12
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
14
11
|
client_id: { ...ga4_properties_1.client_id },
|
|
15
12
|
user_id: { ...ga4_properties_1.user_id },
|
|
16
13
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -29,11 +26,7 @@ const action = {
|
|
|
29
26
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
30
27
|
params: ga4_properties_1.params
|
|
31
28
|
},
|
|
32
|
-
perform: (request, { payload, features
|
|
33
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
34
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
35
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
36
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
29
|
+
perform: (request, { payload, features }) => {
|
|
37
30
|
ga4_functions_1.verifyCurrency(payload.currency);
|
|
38
31
|
let googleItems = [];
|
|
39
32
|
if (payload.items) {
|
|
@@ -52,7 +45,7 @@ const action = {
|
|
|
52
45
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
53
46
|
}
|
|
54
47
|
const request_object = {
|
|
55
|
-
|
|
48
|
+
client_id: payload.client_id,
|
|
56
49
|
user_id: payload.user_id,
|
|
57
50
|
events: [
|
|
58
51
|
{
|
|
@@ -76,7 +69,10 @@ const action = {
|
|
|
76
69
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
77
70
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
78
71
|
}
|
|
79
|
-
return
|
|
72
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
json: request_object
|
|
75
|
+
});
|
|
80
76
|
}
|
|
81
77
|
};
|
|
82
78
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/purchase/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/purchase/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,oDAAkG;AAElG,sDAgB0B;AAI1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,6CAA6C;IAC1D,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,WAAW,EAAE,EAAE,GAAG,4BAAW,EAAE;QAC/B,MAAM,EAAE,EAAE,GAAG,uBAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,EAAE;QAClE,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAGzC,KAAK,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5B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,UAAU;oBAChB,MAAM,EAAE;wBACN,WAAW,EAAE,OAAO,CAAC,WAAW;wBAChC,MAAM,EAAE,OAAO,CAAC,MAAM;wBACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,KAAK,EAAE,WAAW;wBAClB,cAAc,EAAE,OAAO,CAAC,cAAc;wBACtC,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,GAAG,EAAE,OAAO,CAAC,GAAG;wBAChB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;wBAClD,GAAG,OAAO,CAAC,MAAM;qBAClB;iBACF;aACF;YACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;SACjD,CAAA;QAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,0CAA0C,CAAC,EAAE;YACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
-
const ga4_types_1 = require("../ga4-types");
|
|
7
6
|
const action = {
|
|
8
7
|
title: 'Refund',
|
|
9
8
|
description: 'Send event when a refund is issued',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Order Refunded"',
|
|
11
10
|
fields: {
|
|
12
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
14
11
|
client_id: { ...ga4_properties_1.client_id },
|
|
15
12
|
user_id: { ...ga4_properties_1.user_id },
|
|
16
13
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -32,11 +29,7 @@ const action = {
|
|
|
32
29
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
33
30
|
params: ga4_properties_1.params
|
|
34
31
|
},
|
|
35
|
-
perform: (request, { payload, features
|
|
36
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
37
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
38
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
39
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
32
|
+
perform: (request, { payload, features }) => {
|
|
40
33
|
if (payload.currency) {
|
|
41
34
|
ga4_functions_1.verifyCurrency(payload.currency);
|
|
42
35
|
}
|
|
@@ -63,7 +56,7 @@ const action = {
|
|
|
63
56
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
64
57
|
}
|
|
65
58
|
const request_object = {
|
|
66
|
-
|
|
59
|
+
client_id: payload.client_id,
|
|
67
60
|
user_id: payload.user_id,
|
|
68
61
|
events: [
|
|
69
62
|
{
|
|
@@ -87,7 +80,10 @@ const action = {
|
|
|
87
80
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
88
81
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
89
82
|
}
|
|
90
|
-
return
|
|
83
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
84
|
+
method: 'POST',
|
|
85
|
+
json: request_object
|
|
86
|
+
});
|
|
91
87
|
}
|
|
92
88
|
};
|
|
93
89
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/refund/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/refund/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAe0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,oCAAoC;IACjD,mBAAmB,EAAE,6CAA6C;IAClE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,cAAc,EAAE,EAAE,GAAG,+BAAc,EAAE,QAAQ,EAAE,IAAI,EAAE;QACrD,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,EAAE;QAC/D,WAAW,EAAE,EAAE,GAAG,4BAAW,EAAE;QAC/B,MAAM,EAAE,EAAE,GAAG,uBAAM,EAAE;QACrB,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,GAAG,EAAE;YACH,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yCAAyC;SACvD;QACD,KAAK,EAAE;YACL,GAAG,qCAAoB;SACxB;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,8BAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;SACjC;QAG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;oBACd,MAAM,EAAE;wBACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,cAAc,EAAE,OAAO,CAAC,cAAc;wBACtC,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,WAAW,EAAE,OAAO,CAAC,WAAW;wBAChC,MAAM,EAAE,OAAO,CAAC,MAAM;wBACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,GAAG,EAAE,OAAO,CAAC,GAAG;wBAChB,KAAK,EAAE,WAAW;wBAClB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;wBAClD,GAAG,OAAO,CAAC,MAAM;qBAClB;iBACF;aACF;YACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;SACjD,CAAA;QAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,0CAA0C,CAAC,EAAE;YACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
-
const ga4_types_1 = require("../ga4-types");
|
|
7
6
|
const action = {
|
|
8
7
|
title: 'Remove from Cart',
|
|
9
8
|
description: 'Send event when a user removes items from a cart',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Product Removed"',
|
|
11
10
|
fields: {
|
|
12
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
14
11
|
client_id: { ...ga4_properties_1.client_id },
|
|
15
12
|
user_id: { ...ga4_properties_1.user_id },
|
|
16
13
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -24,11 +21,7 @@ const action = {
|
|
|
24
21
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
25
22
|
params: ga4_properties_1.params
|
|
26
23
|
},
|
|
27
|
-
perform: (request, { payload, features
|
|
28
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
29
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
30
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
31
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
24
|
+
perform: (request, { payload, features }) => {
|
|
32
25
|
if (payload.currency) {
|
|
33
26
|
ga4_functions_1.verifyCurrency(payload.currency);
|
|
34
27
|
}
|
|
@@ -55,7 +48,7 @@ const action = {
|
|
|
55
48
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
56
49
|
}
|
|
57
50
|
const request_object = {
|
|
58
|
-
|
|
51
|
+
client_id: payload.client_id,
|
|
59
52
|
user_id: payload.user_id,
|
|
60
53
|
events: [
|
|
61
54
|
{
|
|
@@ -74,7 +67,10 @@ const action = {
|
|
|
74
67
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
75
68
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
76
69
|
}
|
|
77
|
-
return
|
|
70
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
71
|
+
method: 'POST',
|
|
72
|
+
json: request_object
|
|
73
|
+
});
|
|
78
74
|
}
|
|
79
75
|
};
|
|
80
76
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/removeFromCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/removeFromCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAW0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,kDAAkD;IAC/D,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,8BAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;SACjC;QAGD,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE;YACnD,MAAM,IAAI,+BAAgB,CAAC,uCAAuC,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;SACzG;QAOD,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE;YACzG,MAAM,IAAI,+BAAgB,CACx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O,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ga4_functions_1 = require("../ga4-functions");
|
|
4
4
|
const ga4_properties_1 = require("../ga4-properties");
|
|
5
|
-
const ga4_types_1 = require("../ga4-types");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Search',
|
|
8
7
|
description: 'Send event when a user searches your content',
|
|
9
8
|
defaultSubscription: 'type = "track" and event = "Products Searched"',
|
|
10
9
|
fields: {
|
|
11
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
12
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
13
10
|
client_id: { ...ga4_properties_1.client_id },
|
|
14
11
|
user_id: { ...ga4_properties_1.user_id },
|
|
15
12
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -26,17 +23,13 @@ const action = {
|
|
|
26
23
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
27
24
|
params: ga4_properties_1.params
|
|
28
25
|
},
|
|
29
|
-
perform: (request, { payload, features
|
|
30
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
31
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
32
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
33
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
26
|
+
perform: (request, { payload, features }) => {
|
|
34
27
|
if (features && features['actions-google-analytics-4-verify-params-feature']) {
|
|
35
28
|
ga4_functions_1.verifyParams(payload.params);
|
|
36
29
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
37
30
|
}
|
|
38
31
|
const request_object = {
|
|
39
|
-
|
|
32
|
+
client_id: payload.client_id,
|
|
40
33
|
user_id: payload.user_id,
|
|
41
34
|
events: [
|
|
42
35
|
{
|
|
@@ -53,7 +46,10 @@ const action = {
|
|
|
53
46
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
54
47
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
55
48
|
}
|
|
56
|
-
return
|
|
49
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
50
|
+
method: 'POST',
|
|
51
|
+
json: request_object
|
|
52
|
+
});
|
|
57
53
|
}
|
|
58
54
|
};
|
|
59
55
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/search/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/search/index.ts"],"names":[],"mappings":";;AAGA,oDAAkF;AAClF,sDAQ0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,8CAA8C;IAC3D,mBAAmB,EAAE,gDAAgD;IACrE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,oBAAoB;aAC9B;SACF;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,QAAQ,IAAI,QAAQ,CAAC,kDAAkD,CAAC,EAAE;YAC5E,4BAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAC5B,+BAAe,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;SACzC;QACD,MAAM,cAAc,GAA2B;YAC7C,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE;wBACN,WAAW,EAAE,OAAO,CAAC,WAAW;wBAChC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;wBAClD,GAAG,OAAO,CAAC,MAAM;qBAClB;iBACF;aACF;YACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;SACjD,CAAA;QAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,0CAA0C,CAAC,EAAE;YACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
|
-
const ga4_types_1 = require("../ga4-types");
|
|
6
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
7
6
|
const action = {
|
|
8
7
|
title: 'Select Item',
|
|
9
8
|
description: 'Send event when a user selects an item from a list',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Product Clicked"',
|
|
11
10
|
fields: {
|
|
12
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
14
11
|
client_id: { ...ga4_properties_1.client_id },
|
|
15
12
|
user_id: { ...ga4_properties_1.user_id },
|
|
16
13
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -32,11 +29,7 @@ const action = {
|
|
|
32
29
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
33
30
|
params: ga4_properties_1.params
|
|
34
31
|
},
|
|
35
|
-
perform: (request, { payload, features
|
|
36
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
37
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
38
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
39
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
32
|
+
perform: (request, { payload, features }) => {
|
|
40
33
|
let googleItems = [];
|
|
41
34
|
if (payload.items) {
|
|
42
35
|
googleItems = payload.items.map((product) => {
|
|
@@ -54,7 +47,7 @@ const action = {
|
|
|
54
47
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
55
48
|
}
|
|
56
49
|
const request_object = {
|
|
57
|
-
|
|
50
|
+
client_id: payload.client_id,
|
|
58
51
|
user_id: payload.user_id,
|
|
59
52
|
events: [
|
|
60
53
|
{
|
|
@@ -73,7 +66,10 @@ const action = {
|
|
|
73
66
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
74
67
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
75
68
|
}
|
|
76
|
-
return
|
|
69
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
json: request_object
|
|
72
|
+
});
|
|
77
73
|
}
|
|
78
74
|
};
|
|
79
75
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAIlG,sDAS0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,oDAAoD;IACjE,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,mEAAmE;YAChF,IAAI,EAAE,QAAQ;SACf;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,iEAAiE;YAC9E,IAAI,EAAE,QAAQ;SACf;QACD,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,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,EA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