@walkeros/web-source-datalayer 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/examples/index.d.mts +101 -0
- package/dist/examples/index.d.ts +101 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="left">
|
|
2
|
-
<a href="https://
|
|
3
|
-
<img title="elbwalker" src="https://www.
|
|
2
|
+
<a href="https://www.walkeros.io">
|
|
3
|
+
<img title="elbwalker" src="https://www.walkeros.io/img/elbwalker_logo.png" width="256px"/>
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Source, Mapping } from '@walkeros/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Environment interface for dataLayer source
|
|
5
|
+
*/
|
|
6
|
+
interface DataLayerEnv extends Source.BaseEnv {
|
|
7
|
+
window?: typeof window;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Standard mock environment for testing dataLayer source
|
|
11
|
+
*
|
|
12
|
+
* Use this for testing dataLayer.push interception and event transformation
|
|
13
|
+
* without requiring a real browser environment.
|
|
14
|
+
*/
|
|
15
|
+
declare const push: DataLayerEnv;
|
|
16
|
+
|
|
17
|
+
declare const env_push: typeof push;
|
|
18
|
+
declare namespace env {
|
|
19
|
+
export { env_push as push };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Sample gtag events that would be pushed to dataLayer
|
|
24
|
+
* These represent real-world gtag calls that the dataLayer source should transform to WalkerOS events
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Consent Mode Events - Primary use case
|
|
28
|
+
*/
|
|
29
|
+
declare function consentUpdate$1(): unknown[];
|
|
30
|
+
declare function consentDefault(): unknown[];
|
|
31
|
+
/**
|
|
32
|
+
* E-commerce Events
|
|
33
|
+
*/
|
|
34
|
+
declare function purchase$1(): unknown[];
|
|
35
|
+
declare function add_to_cart$1(): unknown[];
|
|
36
|
+
declare function view_item$1(): unknown[];
|
|
37
|
+
/**
|
|
38
|
+
* Config Events
|
|
39
|
+
*/
|
|
40
|
+
declare function config$1(): unknown[];
|
|
41
|
+
/**
|
|
42
|
+
* Set Events
|
|
43
|
+
*/
|
|
44
|
+
declare function setCustom(): unknown[];
|
|
45
|
+
/**
|
|
46
|
+
* Direct dataLayer object pushes (not gtag)
|
|
47
|
+
*/
|
|
48
|
+
declare function directDataLayerEvent(): Record<string, unknown>;
|
|
49
|
+
|
|
50
|
+
declare const events_consentDefault: typeof consentDefault;
|
|
51
|
+
declare const events_directDataLayerEvent: typeof directDataLayerEvent;
|
|
52
|
+
declare const events_setCustom: typeof setCustom;
|
|
53
|
+
declare namespace events {
|
|
54
|
+
export { add_to_cart$1 as add_to_cart, config$1 as config, events_consentDefault as consentDefault, consentUpdate$1 as consentUpdate, events_directDataLayerEvent as directDataLayerEvent, purchase$1 as purchase, events_setCustom as setCustom, view_item$1 as view_item };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Consent Mode Mapping - Primary use case
|
|
59
|
+
* Maps gtag consent events to walker consent commands
|
|
60
|
+
*/
|
|
61
|
+
declare const consentUpdate: Mapping.Rule;
|
|
62
|
+
/**
|
|
63
|
+
* E-commerce Event Mappings
|
|
64
|
+
* Transform GA4 ecommerce events to WalkerOS events
|
|
65
|
+
*/
|
|
66
|
+
declare const purchase: Mapping.Rule;
|
|
67
|
+
declare const add_to_cart: Mapping.Rule;
|
|
68
|
+
declare const view_item: Mapping.Rule;
|
|
69
|
+
/**
|
|
70
|
+
* Config Event Mapping
|
|
71
|
+
* Transform GA4 config events to WalkerOS page events
|
|
72
|
+
*/
|
|
73
|
+
declare const configGA4: Mapping.Rule;
|
|
74
|
+
/**
|
|
75
|
+
* Custom Event Mapping
|
|
76
|
+
* Handle direct dataLayer pushes
|
|
77
|
+
*/
|
|
78
|
+
declare const customEvent: Mapping.Rule;
|
|
79
|
+
/**
|
|
80
|
+
* Complete mapping configuration
|
|
81
|
+
* Following the same pattern as destination mappings
|
|
82
|
+
*/
|
|
83
|
+
declare const config: Mapping.Rules;
|
|
84
|
+
/**
|
|
85
|
+
* Minimal consent-only mapping for focused use cases
|
|
86
|
+
*/
|
|
87
|
+
declare const consentOnlyMapping: Mapping.Rules;
|
|
88
|
+
|
|
89
|
+
declare const mapping_add_to_cart: typeof add_to_cart;
|
|
90
|
+
declare const mapping_config: typeof config;
|
|
91
|
+
declare const mapping_configGA4: typeof configGA4;
|
|
92
|
+
declare const mapping_consentOnlyMapping: typeof consentOnlyMapping;
|
|
93
|
+
declare const mapping_consentUpdate: typeof consentUpdate;
|
|
94
|
+
declare const mapping_customEvent: typeof customEvent;
|
|
95
|
+
declare const mapping_purchase: typeof purchase;
|
|
96
|
+
declare const mapping_view_item: typeof view_item;
|
|
97
|
+
declare namespace mapping {
|
|
98
|
+
export { mapping_add_to_cart as add_to_cart, mapping_config as config, mapping_configGA4 as configGA4, mapping_consentOnlyMapping as consentOnlyMapping, mapping_consentUpdate as consentUpdate, mapping_customEvent as customEvent, mapping_purchase as purchase, mapping_view_item as view_item };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { events as Events, mapping as Mapping, consentOnlyMapping, consentUpdate$1 as consentUpdateEvent, config as dataLayerExamples, env };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Source, Mapping } from '@walkeros/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Environment interface for dataLayer source
|
|
5
|
+
*/
|
|
6
|
+
interface DataLayerEnv extends Source.BaseEnv {
|
|
7
|
+
window?: typeof window;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Standard mock environment for testing dataLayer source
|
|
11
|
+
*
|
|
12
|
+
* Use this for testing dataLayer.push interception and event transformation
|
|
13
|
+
* without requiring a real browser environment.
|
|
14
|
+
*/
|
|
15
|
+
declare const push: DataLayerEnv;
|
|
16
|
+
|
|
17
|
+
declare const env_push: typeof push;
|
|
18
|
+
declare namespace env {
|
|
19
|
+
export { env_push as push };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Sample gtag events that would be pushed to dataLayer
|
|
24
|
+
* These represent real-world gtag calls that the dataLayer source should transform to WalkerOS events
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Consent Mode Events - Primary use case
|
|
28
|
+
*/
|
|
29
|
+
declare function consentUpdate$1(): unknown[];
|
|
30
|
+
declare function consentDefault(): unknown[];
|
|
31
|
+
/**
|
|
32
|
+
* E-commerce Events
|
|
33
|
+
*/
|
|
34
|
+
declare function purchase$1(): unknown[];
|
|
35
|
+
declare function add_to_cart$1(): unknown[];
|
|
36
|
+
declare function view_item$1(): unknown[];
|
|
37
|
+
/**
|
|
38
|
+
* Config Events
|
|
39
|
+
*/
|
|
40
|
+
declare function config$1(): unknown[];
|
|
41
|
+
/**
|
|
42
|
+
* Set Events
|
|
43
|
+
*/
|
|
44
|
+
declare function setCustom(): unknown[];
|
|
45
|
+
/**
|
|
46
|
+
* Direct dataLayer object pushes (not gtag)
|
|
47
|
+
*/
|
|
48
|
+
declare function directDataLayerEvent(): Record<string, unknown>;
|
|
49
|
+
|
|
50
|
+
declare const events_consentDefault: typeof consentDefault;
|
|
51
|
+
declare const events_directDataLayerEvent: typeof directDataLayerEvent;
|
|
52
|
+
declare const events_setCustom: typeof setCustom;
|
|
53
|
+
declare namespace events {
|
|
54
|
+
export { add_to_cart$1 as add_to_cart, config$1 as config, events_consentDefault as consentDefault, consentUpdate$1 as consentUpdate, events_directDataLayerEvent as directDataLayerEvent, purchase$1 as purchase, events_setCustom as setCustom, view_item$1 as view_item };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Consent Mode Mapping - Primary use case
|
|
59
|
+
* Maps gtag consent events to walker consent commands
|
|
60
|
+
*/
|
|
61
|
+
declare const consentUpdate: Mapping.Rule;
|
|
62
|
+
/**
|
|
63
|
+
* E-commerce Event Mappings
|
|
64
|
+
* Transform GA4 ecommerce events to WalkerOS events
|
|
65
|
+
*/
|
|
66
|
+
declare const purchase: Mapping.Rule;
|
|
67
|
+
declare const add_to_cart: Mapping.Rule;
|
|
68
|
+
declare const view_item: Mapping.Rule;
|
|
69
|
+
/**
|
|
70
|
+
* Config Event Mapping
|
|
71
|
+
* Transform GA4 config events to WalkerOS page events
|
|
72
|
+
*/
|
|
73
|
+
declare const configGA4: Mapping.Rule;
|
|
74
|
+
/**
|
|
75
|
+
* Custom Event Mapping
|
|
76
|
+
* Handle direct dataLayer pushes
|
|
77
|
+
*/
|
|
78
|
+
declare const customEvent: Mapping.Rule;
|
|
79
|
+
/**
|
|
80
|
+
* Complete mapping configuration
|
|
81
|
+
* Following the same pattern as destination mappings
|
|
82
|
+
*/
|
|
83
|
+
declare const config: Mapping.Rules;
|
|
84
|
+
/**
|
|
85
|
+
* Minimal consent-only mapping for focused use cases
|
|
86
|
+
*/
|
|
87
|
+
declare const consentOnlyMapping: Mapping.Rules;
|
|
88
|
+
|
|
89
|
+
declare const mapping_add_to_cart: typeof add_to_cart;
|
|
90
|
+
declare const mapping_config: typeof config;
|
|
91
|
+
declare const mapping_configGA4: typeof configGA4;
|
|
92
|
+
declare const mapping_consentOnlyMapping: typeof consentOnlyMapping;
|
|
93
|
+
declare const mapping_consentUpdate: typeof consentUpdate;
|
|
94
|
+
declare const mapping_customEvent: typeof customEvent;
|
|
95
|
+
declare const mapping_purchase: typeof purchase;
|
|
96
|
+
declare const mapping_view_item: typeof view_item;
|
|
97
|
+
declare namespace mapping {
|
|
98
|
+
export { mapping_add_to_cart as add_to_cart, mapping_config as config, mapping_configGA4 as configGA4, mapping_consentOnlyMapping as consentOnlyMapping, mapping_consentUpdate as consentUpdate, mapping_customEvent as customEvent, mapping_purchase as purchase, mapping_view_item as view_item };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { events as Events, mapping as Mapping, consentOnlyMapping, consentUpdate$1 as consentUpdateEvent, config as dataLayerExamples, env };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-source-datalayer",
|
|
3
3
|
"description": "DataLayer source for walkerOS",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"update": "npx npm-check-updates -u && npm update"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@walkeros/core": "0.
|
|
39
|
-
"@walkeros/collector": "0.
|
|
38
|
+
"@walkeros/core": "0.5.0",
|
|
39
|
+
"@walkeros/collector": "0.5.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/gtag.js": "^0.0.20"
|