Skip to content

Commit 9642bca

Browse files
session consent config
1 parent 15e8ecf commit 9642bca

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

website/docs/sources/walkerjs/configuration.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@ const walkerjs = Walkerjs({
1515
consent: 'functional', // Require functional consent
1616
},
1717
elb: 'elb', // Assign the elb function to the window
18-
globals: {
18+
globalsStatic: {
1919
tagged: false, // A static global attribute
2020
},
2121
pageview: true, // Trigger a page view event with each run
2222
run: true, // Automatically start running
2323
session: {
2424
storage: true, // Use the storage for session detection
25-
consent: 'marketing', // Require marketing consent to access storage
25+
consent: ['analytics', 'marketing'], // Required consent states to access storage
2626
length: 60, // Session length in minutes
2727
},
28+
sessionStatic: { id: 's3ss10n', device: 'd3v1c3' }, // Static session data
2829
tagging: 1, // Current version of the tagging
30+
user: { id: '1d', device: 'overruled' }, // Static user data
2931
});
3032
```
3133

@@ -37,12 +39,13 @@ const walkerjs = Walkerjs({
3739
| default | boolean | Add dataLayer destination and run automatically |
3840
| elb | string | Name of assign the elb function to the window |
3941
| elbLayer | object | Public elbwalker API for async communication |
40-
| globals | object | Static attributes added to each event |
42+
| globalsStatic | object | Static default attributes added to each event |
4143
| instance | string | Name of the walker.js instance to assign to the window |
4244
| pageview | boolean | Trigger a page view event by default |
4345
| prefix | string | Attributes prefix used by walker |
4446
| run | boolean | Automatically start running |
4547
| session | false or<br />SessionConfig | Configuration for session detection |
48+
| sessionStatic | object | Static default session data |
4649
| tagging | number | Current version of the tagging setup |
4750
| user | object | Setting the user ids including id, device, and session |
4851

website/docs/utils/session.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ access permissions.
3737

3838
## Session Data
3939

40-
Depending on enabling the `storage` parameter, the `sessionStart` function
40+
Depending on the `storage` parameter `consent`, the `sessionStart` function
4141
returns an object with several properties. If a new session is detected,
4242
`isStart` is set to `true`, otherwise `false`.
4343

@@ -50,8 +50,8 @@ returns an object with several properties. If a new session is detected,
5050
| marketing | true | If the session was started by a marketing parameter |
5151
| referrer | string | Hostname of the referring site if available |
5252

53-
With `storage: true` and eventually granted `consent`, the returning object will
54-
be extended with the following:
53+
With `storage: true` and granted `consent`, the returning object will be
54+
extended with the following:
5555

5656
| Property | Type | Description |
5757
| -------- | ------- | ------------------------------------------------- |
@@ -104,7 +104,7 @@ are optional for customization:
104104

105105
| Parameter | Type | Description |
106106
| ------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------- |
107-
| [consent](#consent) | string | The consent state to permit or deny storage access |
107+
| [consent](#consent) | Array&lt;string&gt; | The consent state to permit or deny storage access |
108108
| [storage](#storage) | boolean | If the storage should be used |
109109
| [cb](#callback) | false or<br />function | Callback function that gets called after the detection process. <br />Or to disable default callback |
110110

@@ -119,8 +119,8 @@ There are additional config parameters [for storage](#sessionstorage) and
119119

120120
Setting a consent state to wait for before detecting a new session is used to
121121
decide if storage access is allowed or not. If set, it registers an
122-
[on consent event](/docs/sources/walkerjs/commands#on) and won't start until
123-
that consent choice is available. If permission was granted, the
122+
[on consent event](/docs/sources/walkerjs/commands#on) and won't start until a
123+
consent choice is available. If at least one permission was granted, the
124124
`sessionStorage` detects a new session; otherwise, the `sessionWindow`.
125125

126126
```js
@@ -164,7 +164,7 @@ Based on the [storage](#storage) option either the
164164
[sessionStorage](#sessionstorage) or the [sessionWindow](#sessionwindow) is used
165165
to detect a new session. If a [consent](#consent) state is set, the session
166166
detection gets scheduled via an [on-consent](/docs/sources/walkerjs/commands#on)
167-
command.
167+
command. It will only run once per `run`.
168168

169169
```mermaid
170170
---

0 commit comments

Comments
 (0)