@segment/action-destinations 3.131.1-ga4-cloud.12 → 3.131.1-gads-test.19
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/algolia-insights/algolia-insight-api.d.ts +26 -0
- package/dist/destinations/algolia-insights/algolia-insight-api.js +8 -0
- package/dist/destinations/algolia-insights/algolia-insight-api.js.map +1 -0
- package/dist/destinations/algolia-insights/conversionEvents/generated-types.d.ts +9 -0
- package/dist/destinations/algolia-insights/conversionEvents/generated-types.js +3 -0
- package/dist/destinations/algolia-insights/conversionEvents/generated-types.js.map +1 -0
- package/dist/destinations/algolia-insights/conversionEvents/index.d.ts +6 -0
- package/dist/destinations/algolia-insights/conversionEvents/index.js +83 -0
- package/dist/destinations/algolia-insights/conversionEvents/index.js.map +1 -0
- package/dist/destinations/algolia-insights/generated-types.d.ts +4 -0
- package/dist/destinations/algolia-insights/generated-types.js +3 -0
- package/dist/destinations/algolia-insights/generated-types.js.map +1 -0
- package/dist/destinations/algolia-insights/index.d.ts +5 -0
- package/dist/destinations/algolia-insights/index.js +54 -0
- package/dist/destinations/algolia-insights/index.js.map +1 -0
- package/dist/destinations/algolia-insights/productClickedEvents/generated-types.d.ts +8 -0
- package/dist/destinations/algolia-insights/productClickedEvents/generated-types.js +3 -0
- package/dist/destinations/algolia-insights/productClickedEvents/generated-types.js.map +1 -0
- package/dist/destinations/algolia-insights/productClickedEvents/index.d.ts +6 -0
- package/dist/destinations/algolia-insights/productClickedEvents/index.js +91 -0
- package/dist/destinations/algolia-insights/productClickedEvents/index.js.map +1 -0
- package/dist/destinations/algolia-insights/productViewedEvents/generated-types.d.ts +7 -0
- package/dist/destinations/algolia-insights/productViewedEvents/generated-types.js +3 -0
- package/dist/destinations/algolia-insights/productViewedEvents/generated-types.js.map +1 -0
- package/dist/destinations/algolia-insights/productViewedEvents/index.d.ts +6 -0
- package/dist/destinations/algolia-insights/productViewedEvents/index.js +81 -0
- package/dist/destinations/algolia-insights/productViewedEvents/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.d.ts +20 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.js +133 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.d.ts +2 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.js +6 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.d.ts +80 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.js +151 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.d.ts +35 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.js +3 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.d.ts +5 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.js +619 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/generated-types.d.ts +3 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/generated-types.js +3 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/generated-types.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/index.d.ts +4 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/index.js +53 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.d.ts +67 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.js +3 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +8 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.js +44 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.js.map +1 -0
- package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +3 -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 +3 -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 +3 -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 +3 -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 +3 -10
- package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-functions.d.ts +0 -3
- package/dist/destinations/google-analytics-4/ga4-functions.js +1 -31
- 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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -10
- package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/functions.d.ts +2 -1
- package/dist/destinations/google-enhanced-conversions/functions.js +2 -2
- package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/types.d.ts +2 -1
- package/dist/destinations/google-enhanced-conversions/types.js +8 -2
- package/dist/destinations/google-enhanced-conversions/types.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +3 -3
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +3 -3
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +2 -2
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
- package/dist/destinations/heap/flat.d.ts +1 -2
- package/dist/destinations/heap/flat.js +11 -1
- package/dist/destinations/heap/flat.js.map +1 -1
- package/dist/destinations/heap/heapUtils.d.ts +8 -0
- package/dist/destinations/heap/heapUtils.js +41 -0
- package/dist/destinations/heap/heapUtils.js.map +1 -0
- package/dist/destinations/heap/trackEvent/generated-types.d.ts +0 -1
- package/dist/destinations/heap/trackEvent/index.js +18 -54
- package/dist/destinations/heap/trackEvent/index.js.map +1 -1
- package/dist/destinations/launchpad/generated-types.d.ts +5 -0
- package/dist/destinations/launchpad/generated-types.js +3 -0
- package/dist/destinations/launchpad/generated-types.js.map +1 -0
- package/dist/destinations/launchpad/groupIdentifyUser/generated-types.d.ts +9 -0
- package/dist/destinations/launchpad/groupIdentifyUser/generated-types.js +3 -0
- package/dist/destinations/launchpad/groupIdentifyUser/generated-types.js.map +1 -0
- package/dist/destinations/launchpad/groupIdentifyUser/index.d.ts +5 -0
- package/dist/destinations/launchpad/groupIdentifyUser/index.js +79 -0
- package/dist/destinations/launchpad/groupIdentifyUser/index.js.map +1 -0
- package/dist/destinations/launchpad/identifyUser/generated-types.d.ts +8 -0
- package/dist/destinations/launchpad/identifyUser/generated-types.js +3 -0
- package/dist/destinations/launchpad/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/launchpad/identifyUser/index.d.ts +5 -0
- package/dist/destinations/launchpad/identifyUser/index.js +79 -0
- package/dist/destinations/launchpad/identifyUser/index.js.map +1 -0
- package/dist/destinations/launchpad/index.d.ts +4 -0
- package/dist/destinations/launchpad/index.js +96 -0
- package/dist/destinations/launchpad/index.js.map +1 -0
- package/dist/destinations/launchpad/launchpad-types.d.ts +28 -0
- package/dist/destinations/launchpad/launchpad-types.js +3 -0
- package/dist/destinations/launchpad/launchpad-types.js.map +1 -0
- package/dist/destinations/launchpad/trackEvent/generated-types.d.ts +18 -0
- package/dist/destinations/launchpad/trackEvent/generated-types.js +3 -0
- package/dist/destinations/launchpad/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/launchpad/trackEvent/index.d.ts +5 -0
- package/dist/destinations/launchpad/trackEvent/index.js +62 -0
- package/dist/destinations/launchpad/trackEvent/index.js.map +1 -0
- package/dist/destinations/launchpad/trackEvent/launchpad-properties.d.ts +2 -0
- package/dist/destinations/launchpad/trackEvent/launchpad-properties.js +87 -0
- package/dist/destinations/launchpad/trackEvent/launchpad-properties.js.map +1 -0
- package/dist/destinations/launchpad/utils.d.ts +6 -0
- package/dist/destinations/launchpad/utils.js +20 -0
- package/dist/destinations/launchpad/utils.js.map +1 -0
- package/dist/destinations/livelike-cloud/generated-types.d.ts +4 -0
- package/dist/destinations/livelike-cloud/generated-types.js +3 -0
- package/dist/destinations/livelike-cloud/generated-types.js.map +1 -0
- package/dist/destinations/livelike-cloud/index.d.ts +4 -0
- package/dist/destinations/livelike-cloud/index.js +84 -0
- package/dist/destinations/livelike-cloud/index.js.map +1 -0
- package/dist/destinations/livelike-cloud/properties.d.ts +1 -0
- package/dist/destinations/livelike-cloud/properties.js +5 -0
- package/dist/destinations/livelike-cloud/properties.js.map +1 -0
- package/dist/destinations/livelike-cloud/trackEvent/generated-types.d.ts +11 -0
- package/dist/destinations/livelike-cloud/trackEvent/generated-types.js +3 -0
- package/dist/destinations/livelike-cloud/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/livelike-cloud/trackEvent/index.d.ts +5 -0
- package/dist/destinations/livelike-cloud/trackEvent/index.js +101 -0
- package/dist/destinations/livelike-cloud/trackEvent/index.js.map +1 -0
- package/dist/destinations/pinterest-conversions/generated-types.d.ts +4 -0
- package/dist/destinations/pinterest-conversions/generated-types.js +3 -0
- package/dist/destinations/pinterest-conversions/generated-types.js.map +1 -0
- package/dist/destinations/pinterest-conversions/index.d.ts +4 -0
- package/dist/destinations/pinterest-conversions/index.js +29 -0
- package/dist/destinations/pinterest-conversions/index.js.map +1 -0
- package/dist/destinations/twilio-studio/generated-types.d.ts +6 -0
- package/dist/destinations/twilio-studio/generated-types.js +3 -0
- package/dist/destinations/twilio-studio/generated-types.js.map +1 -0
- package/dist/destinations/twilio-studio/index.d.ts +4 -0
- package/dist/destinations/twilio-studio/index.js +55 -0
- package/dist/destinations/twilio-studio/index.js.map +1 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/generated-types.d.ts +8 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/generated-types.js +3 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/generated-types.js.map +1 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/index.d.ts +5 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/index.js +84 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/index.js.map +1 -0
- package/dist/destinations/twilio-studio/utils.d.ts +29 -0
- package/dist/destinations/twilio-studio/utils.js +43 -0
- package/dist/destinations/twilio-studio/utils.js.map +1 -0
- package/dist/destinations/vwo/identifyUser/index.js +6 -6
- package/dist/destinations/vwo/identifyUser/index.js.map +1 -1
- package/dist/destinations/vwo/index.js +1 -1
- package/dist/destinations/vwo/index.js.map +1 -1
- package/dist/destinations/vwo/pageVisit/index.js +6 -6
- package/dist/destinations/vwo/pageVisit/index.js.map +1 -1
- package/dist/destinations/vwo/trackEvent/index.js +7 -7
- package/dist/destinations/vwo/trackEvent/index.js.map +1 -1
- package/dist/destinations/vwo/utility.js +2 -2
- package/package.json +4 -4
|
@@ -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,7 @@ 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 request(
|
|
49
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
57
50
|
method: 'POST',
|
|
58
51
|
json: request_object
|
|
59
52
|
});
|
|
@@ -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/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E,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,7 @@ 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 request(
|
|
69
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
77
70
|
method: 'POST',
|
|
78
71
|
json: request_object
|
|
79
72
|
});
|
|
@@ -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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B;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: 'Select Promotion',
|
|
9
8
|
description: 'Send event when a user selects a promotion',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Promotion 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 },
|
|
@@ -45,11 +42,7 @@ const action = {
|
|
|
45
42
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
46
43
|
params: ga4_properties_1.params
|
|
47
44
|
},
|
|
48
|
-
perform: (request, { payload, features
|
|
49
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
50
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
51
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
52
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
45
|
+
perform: (request, { payload, features }) => {
|
|
53
46
|
let googleItems = [];
|
|
54
47
|
if (payload.items) {
|
|
55
48
|
googleItems = payload.items.map((product) => {
|
|
@@ -67,7 +60,7 @@ const action = {
|
|
|
67
60
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
68
61
|
}
|
|
69
62
|
const request_object = {
|
|
70
|
-
|
|
63
|
+
client_id: payload.client_id,
|
|
71
64
|
user_id: payload.user_id,
|
|
72
65
|
events: [
|
|
73
66
|
{
|
|
@@ -89,7 +82,7 @@ const action = {
|
|
|
89
82
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
90
83
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
91
84
|
}
|
|
92
|
-
return request(
|
|
85
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
93
86
|
method: 'POST',
|
|
94
87
|
json: request_object
|
|
95
88
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAc0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,4CAA4C;IACzD,mBAAmB,EAAE,gDAAgD;IACrE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,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ions");
|
|
4
4
|
const ga4_properties_1 = require("../ga4-properties");
|
|
5
|
-
const ga4_types_1 = require("../ga4-types");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Sign Up',
|
|
8
7
|
description: 'Send event when a user signs up to measure the popularity of each sign-up method',
|
|
9
8
|
defaultSubscription: 'type = "track" and event = "Signed Up"',
|
|
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 },
|
|
@@ -25,17 +22,13 @@ const action = {
|
|
|
25
22
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
26
23
|
params: ga4_properties_1.params
|
|
27
24
|
},
|
|
28
|
-
perform: (request, { payload, features
|
|
29
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
30
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
31
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
32
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
25
|
+
perform: (request, { payload, features }) => {
|
|
33
26
|
if (features && features['actions-google-analytics-4-verify-params-feature']) {
|
|
34
27
|
ga4_functions_1.verifyParams(payload.params);
|
|
35
28
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
36
29
|
}
|
|
37
30
|
const request_object = {
|
|
38
|
-
|
|
31
|
+
client_id: payload.client_id,
|
|
39
32
|
user_id: payload.user_id,
|
|
40
33
|
events: [
|
|
41
34
|
{
|
|
@@ -52,7 +45,7 @@ const action = {
|
|
|
52
45
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
53
46
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
54
47
|
}
|
|
55
|
-
return request(
|
|
48
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
56
49
|
method: 'POST',
|
|
57
50
|
json: request_object
|
|
58
51
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/signUp/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/signUp/index.ts"],"names":[],"mappings":";;AAGA,oDAAkF;AAClF,sDAQ0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,kFAAkF;IAC/F,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,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,mBAAmB;aAC7B;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,SAAS;oBACf,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"}
|
|
@@ -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: 'View Cart',
|
|
9
8
|
description: 'Send event when a user views their cart',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Cart Viewed"',
|
|
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,7 @@ 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 request(
|
|
70
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
78
71
|
method: 'POST',
|
|
79
72
|
json: request_object
|
|
80
73
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAW0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,yCAAyC;IACtD,mBAAmB,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 = 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: 'View Item',
|
|
9
8
|
description: 'Send event when a user views an item',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Product Viewed"',
|
|
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
|
}
|
|
@@ -49,7 +42,7 @@ const action = {
|
|
|
49
42
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
50
43
|
}
|
|
51
44
|
const request_object = {
|
|
52
|
-
|
|
45
|
+
client_id: payload.client_id,
|
|
53
46
|
user_id: payload.user_id,
|
|
54
47
|
events: [
|
|
55
48
|
{
|
|
@@ -68,7 +61,7 @@ const action = {
|
|
|
68
61
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
69
62
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
70
63
|
}
|
|
71
|
-
return request(
|
|
64
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
72
65
|
method: 'POST',
|
|
73
66
|
json: request_object
|
|
74
67
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAW0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,sCAAsC;IACnD,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;QAED,IAAI,WAAW,GAAkB,EAAE,CAAA;QAEnC,IAAI,OAAO,CAAC,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;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: 'View Item List',
|
|
9
8
|
description: 'Send event when a user views a list of items or offerings',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Product List Viewed"',
|
|
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 },
|
|
@@ -38,11 +35,7 @@ const action = {
|
|
|
38
35
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
39
36
|
params: ga4_properties_1.params
|
|
40
37
|
},
|
|
41
|
-
perform: (request, { payload, features
|
|
42
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
43
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
44
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
45
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
38
|
+
perform: (request, { payload, features }) => {
|
|
46
39
|
let googleItems = [];
|
|
47
40
|
if (payload.items) {
|
|
48
41
|
googleItems = payload.items.map((product) => {
|
|
@@ -60,7 +53,7 @@ const action = {
|
|
|
60
53
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
61
54
|
}
|
|
62
55
|
const request_object = {
|
|
63
|
-
|
|
56
|
+
client_id: payload.client_id,
|
|
64
57
|
user_id: payload.user_id,
|
|
65
58
|
events: [
|
|
66
59
|
{
|
|
@@ -79,7 +72,7 @@ const action = {
|
|
|
79
72
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
80
73
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
81
74
|
}
|
|
82
|
-
return request(
|
|
75
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
83
76
|
method: 'POST',
|
|
84
77
|
json: request_object
|
|
85
78
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItemList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItemList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAS0B;AAS1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,2DAA2D;IACxE,mBAAmB,EAAE,kDAAkD;IACvE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iEAAiE;YAC9E,OAAO,EAAE;gBACP,OAAO,EAAE,sBAAsB;aAChC;SACF;QACD,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mEAAmE;YAChF,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,KAAK,EAAE;YACL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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: 'View Promotion',
|
|
9
8
|
description: 'Send event when a promotion is shown to a user',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Promotion Viewed"',
|
|
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 },
|
|
@@ -49,11 +46,7 @@ const action = {
|
|
|
49
46
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
50
47
|
params: ga4_properties_1.params
|
|
51
48
|
},
|
|
52
|
-
perform: (request, { payload, features
|
|
53
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
54
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
55
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
56
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
49
|
+
perform: (request, { payload, features }) => {
|
|
57
50
|
let googleItems = [];
|
|
58
51
|
if (payload.items) {
|
|
59
52
|
googleItems = payload.items.map((product) => {
|
|
@@ -71,7 +64,7 @@ const action = {
|
|
|
71
64
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
72
65
|
}
|
|
73
66
|
const request_object = {
|
|
74
|
-
|
|
67
|
+
client_id: payload.client_id,
|
|
75
68
|
user_id: payload.user_id,
|
|
76
69
|
events: [
|
|
77
70
|
{
|
|
@@ -93,7 +86,7 @@ const action = {
|
|
|
93
86
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
94
87
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
95
88
|
}
|
|
96
|
-
return request(
|
|
89
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
97
90
|
method: 'POST',
|
|
98
91
|
json: request_object
|
|
99
92
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAc0B;AAS1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,gDAAgD;IAC7D,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE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ifiedResponse, RequestClient } from '@segment/actions-core';
|
|
3
|
+
import { Features } from '@segment/actions-core/src/mapping-kit';
|
|
3
4
|
export declare function formatCustomVariables(customVariables: object, customVariableIdsResults: Array<ConversionCustomVariable>): object;
|
|
4
5
|
export declare const hash: (value: string | undefined) => string | undefined;
|
|
5
|
-
export declare function getCustomVariables(customerId: string, auth: any, request: RequestClient): Promise<ModifiedResponse<QueryResponse[]>>;
|
|
6
|
+
export declare function getCustomVariables(customerId: string, auth: any, request: RequestClient, features: Features | undefined): Promise<ModifiedResponse<QueryResponse[]>>;
|
|
6
7
|
export declare function handleGoogleErrors(response: ModifiedResponse<PartialErrorResponse>): void;
|
|
7
8
|
export declare function convertTimestamp(timestamp: string | undefined): string | undefined;
|
|
@@ -32,8 +32,8 @@ const hash = (value) => {
|
|
|
32
32
|
return hash.digest('hex');
|
|
33
33
|
};
|
|
34
34
|
exports.hash = hash;
|
|
35
|
-
async function getCustomVariables(customerId, auth, request) {
|
|
36
|
-
return await request(`${types_1.
|
|
35
|
+
async function getCustomVariables(customerId, auth, request, features) {
|
|
36
|
+
return await request(`${types_1.getUrlByVersion(features)}/${customerId}/googleAds:searchStream`, {
|
|
37
37
|
method: 'post',
|
|
38
38
|
headers: {
|
|
39
39
|
authorization: `Bearer ${auth?.accessToken}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/google-enhanced-conversions/functions.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAEnC,wDAAyF;AACzF,
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/google-enhanced-conversions/functions.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAEnC,wDAAyF;AACzF,mCAAyC;AAGzC,SAAgB,qBAAqB,CACnC,eAAuB,EACvB,wBAAyD;IAGzD,MAAM,aAAa,GAA2B,EAAE,CAAA;IAChD,MAAM,CAAC,OAAO,CAAC,wBAAwB,CAAC,C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AAC,GAAG,CAAC,uBAAuB,EAAE;SAC5D;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,uGAAuG;SAC/G;KACF,CAAC,CAAA;AACJ,CAAC;AAhBD,gDAgBC;AAKD,SAAgB,kBAAkB,CAAC,QAAgD;IACjF,IAAI,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE;QACrC,MAAM,IAAI,+BAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAA;KAC/F;AACH,CAAC;AAJD,gDAIC;AAED,SAAgB,gBAAgB,CAAC,SAA6B;IAC5D,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,SAAS,CAAA;KACjB;IACD,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAC9D,CAAC;AALD,4CAKC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Features } from '@segment/actions-core/src/mapping-kit';
|
|
1
2
|
export interface CartItem {
|
|
2
3
|
productId?: string;
|
|
3
4
|
quantity?: number;
|
|
@@ -20,4 +21,4 @@ export interface PartialErrorResponse {
|
|
|
20
21
|
};
|
|
21
22
|
results: {}[];
|
|
22
23
|
}
|
|
23
|
-
export declare
|
|
24
|
+
export declare function getUrlByVersion(features: Features | undefined): string;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.getUrlByVersion = void 0;
|
|
4
|
+
function getUrlByVersion(features) {
|
|
5
|
+
if (features && features['google-enhanced-v12']) {
|
|
6
|
+
return 'https://googleads.googleapis.com/v12/customers';
|
|
7
|
+
}
|
|
8
|
+
return 'https://googleads.googleapis.com/v11/customers';
|
|
9
|
+
}
|
|
10
|
+
exports.getUrlByVersion = getUrlByVersion;
|
|
5
11
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/google-enhanced-conversions/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/google-enhanced-conversions/types.ts"],"names":[],"mappings":";;;AA4BA,SAAgB,eAAe,CAAC,QAA8B;IAC5D,IAAI,QAAQ,IAAI,QAAQ,CAAC,qBAAqB,CAAC,EAAE;QAC/C,OAAO,gDAAgD,CAAA;KACxD;IACD,OAAO,gDAAgD,CAAA;AACzD,CAAC;AALD,0CAKC"}
|