@walkeros/web-source-datalayer 0.0.0-next-20251219153324
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/LICENSE +21 -0
- package/README.md +56 -0
- package/dist/dev.d.mts +36 -0
- package/dist/dev.d.ts +36 -0
- package/dist/dev.js +1 -0
- package/dist/dev.js.map +1 -0
- package/dist/dev.mjs +1 -0
- package/dist/dev.mjs.map +1 -0
- package/dist/examples/index.d.mts +101 -0
- package/dist/examples/index.d.ts +101 -0
- package/dist/examples/index.js +337 -0
- package/dist/examples/index.mjs +311 -0
- package/dist/index.browser.js +1 -0
- package/dist/index.d.mts +169 -0
- package/dist/index.d.ts +169 -0
- package/dist/index.es5.js +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 elbWalker GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<p align="left">
|
|
2
|
+
<a href="https://www.walkeros.io">
|
|
3
|
+
<img title="elbwalker" src="https://www.walkeros.io/img/elbwalker_logo.png" width="256px"/>
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
# DataLayer Source for walkerOS
|
|
8
|
+
|
|
9
|
+
[Source Code](https://github.com/elbwalker/walkerOS/tree/main/packages/web/sources/dataLayer)
|
|
10
|
+
•
|
|
11
|
+
[NPM Package](https://www.npmjs.com/package/@walkeros/web-source-datalayer)
|
|
12
|
+
|
|
13
|
+
This package provides a dataLayer source for walkerOS. It allows you to process
|
|
14
|
+
events from a dataLayer and send them to the walkerOS collector.
|
|
15
|
+
|
|
16
|
+
walkerOS follows a **source → collector → destination** architecture. This
|
|
17
|
+
dataLayer source monitors the browser's dataLayer (commonly used with Google Tag
|
|
18
|
+
Manager) and transforms existing gtag() calls and dataLayer.push() events into
|
|
19
|
+
standardized walkerOS events, enabling seamless migration from traditional
|
|
20
|
+
dataLayer implementations.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install @walkeros/web-source-datalayer
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
Here's a basic example of how to use the dataLayer source:
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { elb } from '@walkeros/collector';
|
|
34
|
+
import { sourceDataLayer } from '@walkeros/web-source-datalayer';
|
|
35
|
+
|
|
36
|
+
sourceDataLayer({ elb });
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Configuration
|
|
40
|
+
|
|
41
|
+
| Name | Type | Description | Required | Example |
|
|
42
|
+
| -------- | ------------------------------------------------------ | ------------------------------------------------------------- | -------- | ----------------------------------------------- |
|
|
43
|
+
| `name` | `string` | DataLayer variable name (default: "dataLayer") | No | `'dataLayer'` |
|
|
44
|
+
| `prefix` | `string` | Event prefix for filtering dataLayer events (default: "gtag") | No | `'gtag'` |
|
|
45
|
+
| `filter` | `(event: unknown) => WalkerOS.PromiseOrValue<boolean>` | Function to filter which dataLayer events to process | No | `(event) => event && typeof event === "object"` |
|
|
46
|
+
|
|
47
|
+
## Contribute
|
|
48
|
+
|
|
49
|
+
Feel free to contribute by submitting an
|
|
50
|
+
[issue](https://github.com/elbwalker/walkerOS/issues), starting a
|
|
51
|
+
[discussion](https://github.com/elbwalker/walkerOS/discussions), or getting in
|
|
52
|
+
[contact](https://calendly.com/elb-alexander/30min).
|
|
53
|
+
|
|
54
|
+
## License
|
|
55
|
+
|
|
56
|
+
This project is licensed under the MIT License.
|
package/dist/dev.d.mts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
|
+
import { z } from '@walkeros/core/dev';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* JavaScript variable name
|
|
6
|
+
* Used for dataLayer variable naming
|
|
7
|
+
*/
|
|
8
|
+
declare const JavaScriptVarName: z.ZodString;
|
|
9
|
+
/**
|
|
10
|
+
* Event prefix
|
|
11
|
+
* Used for filtering dataLayer events
|
|
12
|
+
*/
|
|
13
|
+
declare const EventPrefix: z.ZodString;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* DataLayer source settings schema
|
|
17
|
+
*/
|
|
18
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
19
|
+
name: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
20
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
21
|
+
filter: z.ZodOptional<z.ZodAny>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
24
|
+
|
|
25
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
26
|
+
|
|
27
|
+
declare const index_EventPrefix: typeof EventPrefix;
|
|
28
|
+
declare const index_JavaScriptVarName: typeof JavaScriptVarName;
|
|
29
|
+
type index_Settings = Settings;
|
|
30
|
+
declare const index_SettingsSchema: typeof SettingsSchema;
|
|
31
|
+
declare const index_settings: typeof settings;
|
|
32
|
+
declare namespace index {
|
|
33
|
+
export { index_EventPrefix as EventPrefix, index_JavaScriptVarName as JavaScriptVarName, type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { index as schemas };
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
|
+
import { z } from '@walkeros/core/dev';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* JavaScript variable name
|
|
6
|
+
* Used for dataLayer variable naming
|
|
7
|
+
*/
|
|
8
|
+
declare const JavaScriptVarName: z.ZodString;
|
|
9
|
+
/**
|
|
10
|
+
* Event prefix
|
|
11
|
+
* Used for filtering dataLayer events
|
|
12
|
+
*/
|
|
13
|
+
declare const EventPrefix: z.ZodString;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* DataLayer source settings schema
|
|
17
|
+
*/
|
|
18
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
19
|
+
name: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
20
|
+
prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
21
|
+
filter: z.ZodOptional<z.ZodAny>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
24
|
+
|
|
25
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
26
|
+
|
|
27
|
+
declare const index_EventPrefix: typeof EventPrefix;
|
|
28
|
+
declare const index_JavaScriptVarName: typeof JavaScriptVarName;
|
|
29
|
+
type index_Settings = Settings;
|
|
30
|
+
declare const index_SettingsSchema: typeof SettingsSchema;
|
|
31
|
+
declare const index_settings: typeof settings;
|
|
32
|
+
declare namespace index {
|
|
33
|
+
export { index_EventPrefix as EventPrefix, index_JavaScriptVarName as JavaScriptVarName, type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { index as schemas };
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var t in a)r(e,t,{get:a[t],enumerable:!0})},n={};o(n,{schemas:()=>s}),module.exports=(e=n,((e,o,n,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of t(o))i.call(e,c)||c===n||r(e,c,{get:()=>o[c],enumerable:!(s=a(o,c))||s.enumerable});return e})(r({},"__esModule",{value:!0}),e));var s={};o(s,{EventPrefix:()=>b,JavaScriptVarName:()=>d,SettingsSchema:()=>p,settings:()=>u});var c=require("@walkeros/core/dev"),l=require("@walkeros/core/dev"),f=require("@walkeros/core/dev"),d=f.z.string().min(1).regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,"Must be a valid JavaScript identifier").describe("JavaScript variable name"),b=f.z.string().min(1).describe("Prefix for filtering dataLayer events"),p=l.z.object({name:d.default("dataLayer").describe("DataLayer variable name (default: dataLayer)").optional(),prefix:b.default("dataLayer").describe("Event prefix for filtering which events to process").optional(),filter:l.z.any().describe("Custom filter function: (event: unknown) => boolean | Promise<boolean>").optional()}),u=(0,c.zodToSchema)(p);//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.ts"],"sourcesContent":["export * as schemas from './schemas';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\n\n// Export Zod schemas and types\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema exports (for website PropertyTable and documentation tools)\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\nimport { JavaScriptVarName, EventPrefix } from './primitives';\n\n/**\n * DataLayer source settings schema\n */\nexport const SettingsSchema = z.object({\n name: JavaScriptVarName.default('dataLayer')\n .describe('DataLayer variable name (default: dataLayer)')\n .optional(),\n\n prefix: EventPrefix.default('dataLayer')\n .describe('Event prefix for filtering which events to process')\n .optional(),\n\n filter: z\n .any()\n .describe(\n 'Custom filter function: (event: unknown) => boolean | Promise<boolean>',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * JavaScript variable name\n * Used for dataLayer variable naming\n */\nexport const JavaScriptVarName = z\n .string()\n .min(1)\n .regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/, 'Must be a valid JavaScript identifier')\n .describe('JavaScript variable name');\n\n/**\n * Event prefix\n * Used for filtering dataLayer events\n */\nexport const EventPrefix = z\n .string()\n .min(1)\n .describe('Prefix for filtering dataLayer events');\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,IAAAC,cAAkB;;;ACAlB,iBAAkB;AAMX,IAAM,oBAAoB,aAC9B,OAAO,EACP,IAAI,CAAC,EACL,MAAM,8BAA8B,uCAAuC,EAC3E,SAAS,0BAA0B;AAM/B,IAAM,cAAc,aACxB,OAAO,EACP,IAAI,CAAC,EACL,SAAS,uCAAuC;;;ADb5C,IAAM,iBAAiB,cAAE,OAAO;AAAA,EACrC,MAAM,kBAAkB,QAAQ,WAAW,EACxC,SAAS,8CAA8C,EACvD,SAAS;AAAA,EAEZ,QAAQ,YAAY,QAAQ,WAAW,EACpC,SAAS,oDAAoD,EAC7D,SAAS;AAAA,EAEZ,QAAQ,cACL,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;ADXM,IAAM,eAAW,yBAAY,cAAc;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,a={};((a,r)=>{for(var t in r)e(a,t,{get:r[t],enumerable:!0})})(a,{EventPrefix:()=>n,JavaScriptVarName:()=>o,SettingsSchema:()=>s,settings:()=>f});import{zodToSchema as r}from"@walkeros/core/dev";import{z as t}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var o=i.string().min(1).regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,"Must be a valid JavaScript identifier").describe("JavaScript variable name"),n=i.string().min(1).describe("Prefix for filtering dataLayer events"),s=t.object({name:o.default("dataLayer").describe("DataLayer variable name (default: dataLayer)").optional(),prefix:n.default("dataLayer").describe("Event prefix for filtering which events to process").optional(),filter:t.any().describe("Custom filter function: (event: unknown) => boolean | Promise<boolean>").optional()}),f=r(s);export{a as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\n\n// Export Zod schemas and types\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema exports (for website PropertyTable and documentation tools)\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\nimport { JavaScriptVarName, EventPrefix } from './primitives';\n\n/**\n * DataLayer source settings schema\n */\nexport const SettingsSchema = z.object({\n name: JavaScriptVarName.default('dataLayer')\n .describe('DataLayer variable name (default: dataLayer)')\n .optional(),\n\n prefix: EventPrefix.default('dataLayer')\n .describe('Event prefix for filtering which events to process')\n .optional(),\n\n filter: z\n .any()\n .describe(\n 'Custom filter function: (event: unknown) => boolean | Promise<boolean>',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * JavaScript variable name\n * Used for dataLayer variable naming\n */\nexport const JavaScriptVarName = z\n .string()\n .min(1)\n .regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/, 'Must be a valid JavaScript identifier')\n .describe('JavaScript variable name');\n\n/**\n * Event prefix\n * Used for filtering dataLayer events\n */\nexport const EventPrefix = z\n .string()\n .min(1)\n .describe('Prefix for filtering dataLayer events');\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAMX,IAAM,oBAAoB,EAC9B,OAAO,EACP,IAAI,CAAC,EACL,MAAM,8BAA8B,uCAAuC,EAC3E,SAAS,0BAA0B;AAM/B,IAAM,cAAc,EACxB,OAAO,EACP,IAAI,CAAC,EACL,SAAS,uCAAuC;;;ADb5C,IAAM,iBAAiBC,GAAE,OAAO;AAAA,EACrC,MAAM,kBAAkB,QAAQ,WAAW,EACxC,SAAS,8CAA8C,EACvD,SAAS;AAAA,EAEZ,QAAQ,YAAY,QAAQ,WAAW,EACpC,SAAS,oDAAoD,EAC7D,SAAS;AAAA,EAEZ,QAAQA,GACL,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;ADXM,IAAM,WAAW,YAAY,cAAc;","names":["z","z"]}
|
|
@@ -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 };
|