@picked/client 0.0.1-dev.1785305085063 → 0.0.1-dev.1785908062293
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/.tsbuildinfo +1 -0
- package/dist/api-03c5jvVk.js +38 -0
- package/dist/api-CQxCVIrm.cjs +1 -0
- package/dist/cjs/form/index.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dom-observer/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/explanation/conditions-and-the-logic-engine.md +94 -0
- package/dist/docs/explanation/feature-flag-allocation.md +176 -0
- package/dist/docs/explanation/how-picked-works.md +124 -0
- package/dist/docs/explanation/how-pickedql-works.md +76 -0
- package/dist/docs/explanation/pages-and-flows.md +64 -0
- package/dist/docs/explanation/the-content-model.md +77 -0
- package/dist/docs/explanation/the-two-apis.md +68 -0
- package/dist/docs/explanation/why-server-side-rendering.md +76 -0
- package/dist/docs/explanation/workspaces-and-versions.md +71 -0
- package/dist/docs/how-to/add-a-step-field-or-action.md +43 -0
- package/dist/docs/{pickedql/examples.md → how-to/analytics/index.md} +53 -28
- package/dist/docs/how-to/archive-or-delete-a-workspace.md +46 -0
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +40 -0
- package/dist/docs/how-to/authenticate-with-a-password.md +51 -0
- package/dist/docs/how-to/authenticate-with-an-api-key.md +51 -0
- package/dist/docs/how-to/authenticate-with-oauth.md +40 -0
- package/dist/docs/how-to/build-a-flow.md +83 -0
- package/dist/docs/how-to/connect-the-mcp-server.md +38 -0
- package/dist/docs/how-to/create-a-project.md +29 -0
- package/dist/docs/how-to/create-an-experience.md +42 -0
- package/dist/docs/how-to/create-and-revoke-an-api-key.md +37 -0
- package/dist/docs/how-to/debug-with-the-chrome-extension.md +57 -0
- package/dist/docs/how-to/define-a-page-layout.md +39 -0
- package/dist/docs/how-to/fill-and-publish-a-page.md +50 -0
- package/dist/docs/how-to/install-the-gtm-template.md +84 -0
- package/dist/docs/how-to/install-the-sdk.md +68 -0
- package/dist/docs/how-to/install-the-vite-plugin.md +56 -0
- package/dist/docs/how-to/invite-and-remove-members.md +34 -0
- package/dist/docs/how-to/preview-a-workspace.md +28 -0
- package/dist/docs/how-to/publish-a-workspace.md +30 -0
- package/dist/docs/how-to/read-a-feature-flag.md +101 -0
- package/dist/docs/how-to/register-a-component.md +55 -0
- package/dist/docs/how-to/register-an-action-handler.md +67 -0
- package/dist/docs/how-to/render-a-step-form.md +132 -0
- package/dist/docs/how-to/render-an-unpublished-preview.md +41 -0
- package/dist/docs/how-to/reuse-a-section.md +37 -0
- package/dist/docs/how-to/reuse-a-step-field-or-action.md +28 -0
- package/dist/docs/how-to/roll-back-a-published-version.md +26 -0
- package/dist/docs/how-to/run-an-ab-test.md +49 -0
- package/dist/docs/how-to/run-code-on-a-form-submission.md +125 -0
- package/dist/docs/how-to/server-render-a-page.md +81 -0
- package/dist/docs/how-to/set-a-content-security-policy.md +32 -0
- package/dist/docs/how-to/set-up-mfa.md +69 -0
- package/dist/docs/how-to/upload-and-use-an-asset.mdx +73 -0
- package/dist/docs/how-to/validate-a-field.md +52 -0
- package/dist/docs/how-to/write-a-condition.md +45 -0
- package/dist/docs/how-to/write-a-predicate.md +60 -0
- package/dist/docs/index.md +41 -59
- package/dist/docs/reference/dashboard/actions.mdx +53 -0
- package/dist/docs/reference/dashboard/api-keys.mdx +37 -0
- package/dist/docs/reference/dashboard/conditions.mdx +42 -0
- package/dist/docs/reference/dashboard/content/asset-library.mdx +63 -0
- package/dist/docs/reference/dashboard/content/content-entries.mdx +44 -0
- package/dist/docs/reference/dashboard/content/layouts.mdx +62 -0
- package/dist/docs/reference/dashboard/content/pages.mdx +35 -0
- package/dist/docs/reference/dashboard/content/sections.mdx +28 -0
- package/dist/docs/reference/dashboard/experiences.mdx +51 -0
- package/dist/docs/reference/dashboard/features.mdx +114 -0
- package/dist/docs/reference/dashboard/fields.mdx +100 -0
- package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +58 -0
- package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +57 -0
- package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +72 -0
- package/dist/docs/reference/dashboard/flow-builder/nodes.md +63 -0
- package/dist/docs/reference/dashboard/projects.mdx +44 -0
- package/dist/docs/reference/dashboard/reports.mdx +43 -0
- package/dist/docs/reference/dashboard/steps.mdx +37 -0
- package/dist/docs/reference/dashboard/team-management.md +29 -0
- package/dist/docs/reference/dashboard/workspace-versioning.mdx +30 -0
- package/dist/docs/reference/dashboard/workspaces.mdx +76 -0
- package/dist/docs/{delivery-api → reference/delivery-api}/experience-content.md +17 -5
- package/dist/docs/reference/delivery-api/index.md +45 -0
- package/dist/docs/reference/delivery-api/preview-caching-crawling.md +79 -0
- package/dist/docs/{delivery-api → reference/delivery-api}/project-config.md +15 -6
- package/dist/docs/reference/glossary.md +173 -0
- package/dist/docs/reference/management-api/authentication.md +74 -0
- package/dist/docs/{api → reference/management-api}/authorization-and-scopes.md +70 -47
- package/dist/docs/reference/management-api/error-handling.md +233 -0
- package/dist/docs/{api → reference/management-api}/pagination.md +36 -20
- package/dist/docs/reference/pickedql/data-sources.md +174 -0
- package/dist/docs/reference/pickedql/dimensions.md +87 -0
- package/dist/docs/{pickedql → reference/pickedql}/filtering.md +17 -6
- package/dist/docs/reference/pickedql/index.md +18 -0
- package/dist/docs/reference/pickedql/schema.md +172 -0
- package/dist/docs/reference/pickedql/virtual-functions.md +237 -0
- package/dist/docs/reference/sdk/actions.md +30 -0
- package/dist/docs/{sdk → reference/sdk}/conditions.md +15 -5
- package/dist/docs/reference/sdk/content-security-policy.md +21 -0
- package/dist/docs/reference/sdk/experiences.md +51 -0
- package/dist/docs/reference/sdk/features.md +233 -0
- package/dist/docs/reference/sdk/fields.md +209 -0
- package/dist/docs/reference/sdk/index.md +68 -0
- package/dist/docs/{sdk → reference/sdk}/plugins/create-experience.md +25 -34
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +74 -0
- package/dist/docs/reference/sdk/plugins/index.md +29 -0
- package/dist/docs/{sdk → reference/sdk}/plugins/window-object.md +6 -0
- package/dist/docs/reference/sdk/predicates.md +43 -0
- package/dist/docs/reference/sdk/ssr/index.md +33 -0
- package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +103 -0
- package/dist/docs/reference/sdk/ssr/serialize.md +77 -0
- package/dist/docs/reference/sdk/ssr/slots-and-placements.md +59 -0
- package/dist/docs/reference/sdk/steps.md +87 -0
- package/dist/docs/reference/tools/chrome-extension.md +16 -0
- package/dist/docs/reference/tools/image-optimisation-service.md +104 -0
- package/dist/docs/reference/tools/mcp.md +88 -0
- package/dist/docs/reference/tools/vite-plugin.md +88 -0
- package/dist/docs/tutorials/first-api-call.md +228 -0
- package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +143 -0
- package/dist/docs/tutorials/first-experience.mdx +255 -0
- package/dist/docs/tutorials/first-server-rendered-page.mdx +186 -0
- package/dist/{dom-BwmTHeT7.js → dom-BqcToNL0.js} +1 -3
- package/dist/{dom-CDrHc_j9.cjs → dom-DlLH3FxV.cjs} +1 -1
- package/dist/esm/form/index.js +2 -4
- package/dist/esm/index.js +225 -186
- package/dist/esm/plugins/dom-observer/index.js +1 -1
- package/dist/esm/plugins/dynamic-experiences/index.js +3 -3
- package/dist/esm/preview/index.js +1 -1
- package/dist/esm/server/index.js +33 -31
- package/dist/{experience-instance-DOJShRk5.js → experience-instance-DGk11d8a.js} +3 -3
- package/dist/experience-instance-Dej3P1sE.cjs +1 -0
- package/dist/plugin-CHOVsx7Z.js +287 -0
- package/dist/plugin-DsaGXQHx.cjs +1 -0
- package/dist/{preview-channel-DW9J8t4B.js → preview-channel-CSr96XAo.js} +1 -1
- package/dist/{protocol-DSqOlW2r.js → protocol-C5KkkiZc.js} +1 -1
- package/dist/types/client.d.ts +7 -6
- package/dist/types/data-source/api.d.ts +60 -0
- package/dist/types/data-source/api.d.ts.map +1 -0
- package/dist/types/data-source/provider.d.ts +97 -0
- package/dist/types/data-source/provider.d.ts.map +1 -0
- package/dist/types/entities/action/action.d.ts +5 -4
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +6 -5
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/condition/condition.d.ts +5 -5
- package/dist/types/entities/content/content.d.ts +4 -3
- package/dist/types/entities/experience/experience.d.ts +11 -10
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +10 -9
- package/dist/types/entities/feature/feature.d.ts +19 -2
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +7 -6
- package/dist/types/entities/framework/framework.d.ts +7 -6
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +6 -6
- package/dist/types/entities/plugin/plugin.d.ts +3 -2
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +4 -3
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/response/response-validation.d.ts +3 -2
- package/dist/types/entities/response/response.d.ts +12 -11
- package/dist/types/entities/session/session.d.ts +2 -1
- package/dist/types/entities/step/step.d.ts +6 -5
- package/dist/types/exports.d.ts +2 -1
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/form/build-responses.d.ts +2 -1
- package/dist/types/form/create-field-evaluator.d.ts +4 -3
- package/dist/types/form/create-field-validation.d.ts +5 -4
- package/dist/types/form/create-form.d.ts +7 -6
- package/dist/types/form/create-submit-pipeline.d.ts +7 -6
- package/dist/types/form/get-step-fields.d.ts +3 -2
- package/dist/types/lifecycle/condition-selection.d.ts +14 -4
- package/dist/types/lifecycle/lifecycle.d.ts +4 -3
- package/dist/types/lifecycle/rules-logic.d.ts +4 -3
- package/dist/types/lifecycle/state-snapshot.d.ts +4 -3
- package/dist/types/picked.d.ts +79 -62
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/ping.d.ts +1 -1
- package/dist/types/ping.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +9 -8
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts +3 -2
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
- package/dist/types/plugins/dom-observer/plugin.d.ts +1 -1
- package/dist/types/plugins/dynamic-experiences/hash.d.ts +40 -5
- package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +2 -0
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +4 -36
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +42 -11
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/plugins/web-components/plugin.d.ts +2 -1
- package/dist/types/plugins/window-object/plugin.d.ts +2 -2
- package/dist/types/preview-channel.d.ts +5 -1
- package/dist/types/preview-receiver/index.d.ts +18 -1
- package/dist/types/preview-receiver/protocol.d.ts +10 -1
- package/dist/types/server/index.d.ts +3 -3
- package/dist/types/server/serialize.d.ts +8 -2
- package/dist/types/server/serialize.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +2 -1
- package/dist/types/utils/events.d.ts +6 -6
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +1 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/id.d.ts.map +1 -1
- package/dist/types/utils/logger.d.ts +2 -1
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +2 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +2 -1
- package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +1 -1
- package/dist/types/utils/picked-config.d.ts +2 -1
- package/dist/types/utils/rehydrate-scripts.d.ts +6 -0
- package/dist/types/utils/rehydrate-scripts.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +6 -2
- package/dist/types/utils/storage.d.ts +1 -1
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/package.json +22 -23
- package/dist/api-CPL40b7A.js +0 -40
- package/dist/api-Dz5rgRgQ.cjs +0 -1
- package/dist/docs/actions.mdx +0 -78
- package/dist/docs/api/authentication.md +0 -376
- package/dist/docs/api/error-handling.md +0 -211
- package/dist/docs/api/index.md +0 -197
- package/dist/docs/api-keys.mdx +0 -40
- package/dist/docs/chrome-extension.md +0 -51
- package/dist/docs/conditions.mdx +0 -59
- package/dist/docs/content/asset-library.mdx +0 -93
- package/dist/docs/content/content-entries.mdx +0 -30
- package/dist/docs/content/layouts.mdx +0 -70
- package/dist/docs/content/pages.mdx +0 -67
- package/dist/docs/content/sections.mdx +0 -33
- package/dist/docs/delivery-api/index.md +0 -46
- package/dist/docs/delivery-api/preview-caching-crawling.md +0 -59
- package/dist/docs/experiences.mdx +0 -42
- package/dist/docs/features.mdx +0 -58
- package/dist/docs/fields.mdx +0 -79
- package/dist/docs/flow-builder/building-flows.md +0 -61
- package/dist/docs/flow-builder/condition-builder.md +0 -54
- package/dist/docs/flow-builder/keyboard-shortcuts.md +0 -66
- package/dist/docs/flow-builder/nodes.md +0 -43
- package/dist/docs/flow-builder/overview.mdx +0 -50
- package/dist/docs/gtm-template.md +0 -69
- package/dist/docs/guides/build-a-personalized-page.mdx +0 -143
- package/dist/docs/image-optimisation-service.md +0 -80
- package/dist/docs/mcp.md +0 -120
- package/dist/docs/pickedql/data-sources.md +0 -145
- package/dist/docs/pickedql/dimensions.md +0 -65
- package/dist/docs/pickedql/index.md +0 -36
- package/dist/docs/pickedql/schema.md +0 -156
- package/dist/docs/pickedql/virtual-functions.md +0 -204
- package/dist/docs/projects.mdx +0 -37
- package/dist/docs/reports.mdx +0 -18
- package/dist/docs/sdk/actions.md +0 -66
- package/dist/docs/sdk/content-security-policy.md +0 -32
- package/dist/docs/sdk/experiences.md +0 -46
- package/dist/docs/sdk/features.md +0 -212
- package/dist/docs/sdk/fields.md +0 -263
- package/dist/docs/sdk/index.md +0 -83
- package/dist/docs/sdk/plugins/dynamic-experiences.md +0 -58
- package/dist/docs/sdk/plugins/index.md +0 -9
- package/dist/docs/sdk/predicates.md +0 -112
- package/dist/docs/sdk/ssr/index.md +0 -62
- package/dist/docs/sdk/ssr/rendering-and-hydration.md +0 -141
- package/dist/docs/sdk/ssr/serialize.md +0 -86
- package/dist/docs/sdk/ssr/slots-and-placements.md +0 -35
- package/dist/docs/sdk/steps.md +0 -434
- package/dist/docs/steps.mdx +0 -44
- package/dist/docs/team-management.md +0 -40
- package/dist/docs/vite-plugin.md +0 -82
- package/dist/docs/workspace-versioning.mdx +0 -28
- package/dist/docs/workspaces.mdx +0 -102
- package/dist/experience-instance-DurC3pE-.cjs +0 -1
- package/dist/plugin-CFXwbXeM.js +0 -247
- package/dist/plugin-m4qekgtA.cjs +0 -1
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Data sources
|
|
7
|
+
|
|
8
|
+
PickedQL gives you four virtual tables. Each table is fast for one kind of work. It also gives you three reference tables, and those hold the options of your
|
|
9
|
+
Picked project.
|
|
10
|
+
|
|
11
|
+
## `metrics` — data that PickedQL aggregates each day
|
|
12
|
+
|
|
13
|
+
Use it for a dashboard and to study a trend. There is one row for each unique set of
|
|
14
|
+
dimensions on each day. The dimension columns are there directly, and they need no
|
|
15
|
+
join. Examples are `device_category`, `country_code`, and `utm_source`.
|
|
16
|
+
|
|
17
|
+
```sql
|
|
18
|
+
SELECT device_category, control_users(), variant_users()
|
|
19
|
+
FROM metrics
|
|
20
|
+
WHERE project_id = 'your-project-id'
|
|
21
|
+
GROUP BY device_category
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## `events` — one row for each event of each user
|
|
25
|
+
|
|
26
|
+
Use it for a deep study, for a funnel, and for a breakdown of your own. There is one
|
|
27
|
+
row for each event of each user. PickedQL joins a dimension column, such as
|
|
28
|
+
`device_category` or `country_code`, when you point at it.
|
|
29
|
+
|
|
30
|
+
```sql
|
|
31
|
+
SELECT user_canonical_id, device_category
|
|
32
|
+
FROM events
|
|
33
|
+
WHERE project_id = 'your-project-id'
|
|
34
|
+
AND variant_type = 'Control'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## `features` — one row for each feature flag
|
|
38
|
+
|
|
39
|
+
Use it to count the users, the sessions, and the events for each feature flag and
|
|
40
|
+
bucket. It uses parameterized functions.
|
|
41
|
+
|
|
42
|
+
```sql
|
|
43
|
+
SELECT feature_users('homepage_test', 'control')
|
|
44
|
+
FROM features
|
|
45
|
+
WHERE project_id = 'your-project-id'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## `experience_journey` — step transitions for a sankey chart
|
|
49
|
+
|
|
50
|
+
It returns one `source, target, users` row for each edge. You can put those rows
|
|
51
|
+
directly into a sankey chart or a funnel chart. It holds the eight common table
|
|
52
|
+
expressions that a card carried before. Those call `lagInFrame`, remove a duplicate
|
|
53
|
+
between two steps that follow each other, and rank the top paths.
|
|
54
|
+
|
|
55
|
+
Every filter goes in the **outer `WHERE`** clause. PickedQL reads each one as a
|
|
56
|
+
parameter and puts it into the query below. Only `project_id` is necessary. The rest
|
|
57
|
+
are optional, and each has a sensible default.
|
|
58
|
+
|
|
59
|
+
| Parameter, as a WHERE key | What it does |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `project_id` | The tenant filter. It is necessary. |
|
|
62
|
+
| `experience_id` | Limits the rows to one `fact_events.experience_id`. |
|
|
63
|
+
| `starting_step` | Anchors each edge at the first time that a user reaches this `step_id`. With no value, it anchors at the first `step_enter` event of that user. |
|
|
64
|
+
| `targeting_step` | Trims the window of each user at the first time that the user reaches this `step_id`. A user who never reaches it still gives a journey, up to `num_nodes_after_start`. |
|
|
65
|
+
| `num_nodes_after_start` | The size of the forward window from the start step. |
|
|
66
|
+
| `num_nodes_before_target` | The size of the backward window from the target step. It needs `targeting_step`. |
|
|
67
|
+
| `top_n_path` | Keeps the paths with the most users, and drops the rest. |
|
|
68
|
+
| `user_cohort_event` | Limits the rows to a user with at least one `fact_events` row of this `event_type`, such as `'lead_capture'`. Use it for the paths of the users who reached a goal. |
|
|
69
|
+
| `client_local_date` | A filter on the date. It takes `=`, `<`, `<=`, `>`, `>=`, and `BETWEEN`. PickedQL puts it into the `fact_events` read below. |
|
|
70
|
+
| `event_timestamp` | A filter on the timestamp from the server. It takes the same operators as `client_local_date`. |
|
|
71
|
+
|
|
72
|
+
When you set both `num_nodes_after_start` and `num_nodes_before_target`, both tests
|
|
73
|
+
apply. The result is the intersection of the two.
|
|
74
|
+
|
|
75
|
+
```sql
|
|
76
|
+
-- The "overall user journey" sankey.
|
|
77
|
+
-- It uses a forward window. The target step is optional.
|
|
78
|
+
SELECT source, target, users FROM experience_journey
|
|
79
|
+
WHERE project_id = 'your-project-id'
|
|
80
|
+
AND starting_step = 'step-start'
|
|
81
|
+
AND targeting_step = 'step-target'
|
|
82
|
+
AND num_nodes_after_start = 10
|
|
83
|
+
AND client_local_date >= '2026-04-01' -- An optional range of dates.
|
|
84
|
+
AND client_local_date <= '2026-04-30'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```sql
|
|
88
|
+
-- The "paths to a target" sankey.
|
|
89
|
+
-- It uses a backward window and it ranks the top paths.
|
|
90
|
+
SELECT source, target, users FROM experience_journey
|
|
91
|
+
WHERE project_id = 'your-project-id'
|
|
92
|
+
AND experience_id = 'exp-123'
|
|
93
|
+
AND starting_step = 'step-start'
|
|
94
|
+
AND targeting_step = 'step-target'
|
|
95
|
+
AND num_nodes_before_target = 5
|
|
96
|
+
AND top_n_path = 10
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```sql
|
|
100
|
+
-- The "drop-off" sankey. Leave the target step out.
|
|
101
|
+
SELECT source, target, users FROM experience_journey
|
|
102
|
+
WHERE project_id = 'your-project-id'
|
|
103
|
+
AND experience_id = 'exp-123'
|
|
104
|
+
AND starting_step = 'step-start'
|
|
105
|
+
AND num_nodes_after_start = 10
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```sql
|
|
109
|
+
-- A cohort sankey. It holds the users who reached the goal only.
|
|
110
|
+
SELECT source, target, users FROM experience_journey
|
|
111
|
+
WHERE project_id = 'your-project-id'
|
|
112
|
+
AND starting_step = 'step-start'
|
|
113
|
+
AND targeting_step = 'step-target'
|
|
114
|
+
AND num_nodes_after_start = 10
|
|
115
|
+
AND user_cohort_event = 'lead_capture' -- Users with one or more of these events.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The columns that it returns:
|
|
119
|
+
|
|
120
|
+
| Column | Type | Description |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| `source` | String | The start of the edge, in the form `NN. <step title>`, such as `001. Welcome screen`. PickedQL joins `steps` to find the title. |
|
|
123
|
+
| `target` | String | The end of the edge, in the form `NN. <step title>`. |
|
|
124
|
+
| `users` | `UInt64` | The number of different `user_canonical_id` values that went along this edge. |
|
|
125
|
+
|
|
126
|
+
:::note
|
|
127
|
+
`experience_journey` returns data that PickedQL aggregates first. It does **not**
|
|
128
|
+
support a dimension filter such as `variant_type`, `device_category`, or
|
|
129
|
+
`country_code`. To use one of those, query
|
|
130
|
+
[`events`](#events--one-row-for-each-event-of-each-user) directly and build the
|
|
131
|
+
transitions yourself.
|
|
132
|
+
:::
|
|
133
|
+
|
|
134
|
+
## Reference tables — `steps`, `experiences`, `projects`
|
|
135
|
+
|
|
136
|
+
These reference tables hold the configuration of your Picked project. They have two uses:
|
|
137
|
+
|
|
138
|
+
- **PickedQL joins them onto `events`** when you point at one of their analyst
|
|
139
|
+
columns: `step_title`, `experience_title`, `project_name`, or `project_timezone`.
|
|
140
|
+
- **You can read them directly.** Each one then needs its own tenant filter, so that
|
|
141
|
+
you see only the rows of a project that you can reach.
|
|
142
|
+
|
|
143
|
+
| Source | The tenant filter that it needs |
|
|
144
|
+
|---|---|
|
|
145
|
+
| `steps` | `WHERE project_id = '<project_id>'` |
|
|
146
|
+
| `experiences` | `WHERE project_id = '<project_id>'` |
|
|
147
|
+
| `projects` | `WHERE id = '<project_id>'` |
|
|
148
|
+
|
|
149
|
+
```sql
|
|
150
|
+
-- A direct query that reads the experiences of a project.
|
|
151
|
+
SELECT id, title FROM experiences WHERE project_id = 'your-project-id'
|
|
152
|
+
|
|
153
|
+
-- A direct query that reads the metadata of one project.
|
|
154
|
+
SELECT id, name, timezone FROM projects WHERE id = 'your-project-id'
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
```sql
|
|
158
|
+
-- Pointed at from events. PickedQL adds each LEFT JOIN for you.
|
|
159
|
+
-- The reference tables need no separate tenant filter, because
|
|
160
|
+
-- the event table already limits the join.
|
|
161
|
+
SELECT experience_title, step_title, count(*)
|
|
162
|
+
FROM events
|
|
163
|
+
WHERE project_id = 'your-project-id'
|
|
164
|
+
GROUP BY experience_title, step_title
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
See [Schema, reference tables](/reference/pickedql/schema#steps-experiences-projects) for the full
|
|
168
|
+
column list and the join keys.
|
|
169
|
+
|
|
170
|
+
## Related
|
|
171
|
+
|
|
172
|
+
- [About PickedQL](/explanation/how-pickedql-works) — what the layer expands for you.
|
|
173
|
+
- [Schema](/reference/pickedql/schema)
|
|
174
|
+
- [Analytics queries](/how-to/analytics)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dimension columns
|
|
7
|
+
|
|
8
|
+
Every data source has dimension columns. The `metrics` table holds them directly. On
|
|
9
|
+
`events` and on `features`, PickedQL adds the `LEFT JOIN` that it needs when you
|
|
10
|
+
point at one. You write no join.
|
|
11
|
+
|
|
12
|
+
## The dimensions
|
|
13
|
+
|
|
14
|
+
| Source | Columns |
|
|
15
|
+
|---|---|
|
|
16
|
+
| `dim_variant` | `variant_type`, `ab_feature_name`, `ab_feature_value` |
|
|
17
|
+
| `dim_device` | `device_category`, `browser_name`, `browser_version`, `os_name`, `os_version`, `platform` |
|
|
18
|
+
| `dim_geo` | `country_code`, `country_name`, `region`, `city` |
|
|
19
|
+
| `dim_utm` | `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content` |
|
|
20
|
+
| `dim_product` | `product_name`, `product_category`, `product_page` |
|
|
21
|
+
| `steps` | `step_title` |
|
|
22
|
+
| `experiences` | `experience_title` |
|
|
23
|
+
| `projects` | `project_name`, `project_timezone` |
|
|
24
|
+
|
|
25
|
+
The `steps`, `experiences`, and `projects` sources are reference tables, and they come
|
|
26
|
+
from the operational database. PickedQL joins them onto `events` and `fact_events`
|
|
27
|
+
when you point at one of their analyst-facing columns. Each one **also** needs its own
|
|
28
|
+
tenant filter when you query it directly:
|
|
29
|
+
|
|
30
|
+
| Source | The tenant filter that it needs |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `steps`, `experiences` | `WHERE project_id = '<project_id>'` |
|
|
33
|
+
| `projects` | `WHERE id = '<project_id>'`, because the `id` of the row is the project ID |
|
|
34
|
+
|
|
35
|
+
PickedQL also puts a tenant equality in the `ON` clause of each join that it adds.
|
|
36
|
+
Examples are `AND st.project_id = '<project_id>'` and `AND pr.id = '<project_id>'`.
|
|
37
|
+
ClickHouse then reads part of the dimension table and not all of it. PickedQL puts
|
|
38
|
+
the test in `ON` and not in `WHERE`, because a test in `WHERE` would change a
|
|
39
|
+
`LEFT JOIN` into an inner join.
|
|
40
|
+
|
|
41
|
+
Each analyst-facing column name carries a prefix, such as `step_title` and
|
|
42
|
+
`project_name`. The prefix stops a collision between two sources. Both `steps.title`
|
|
43
|
+
and `experiences.title` are there, and you point at them as `step_title` and
|
|
44
|
+
`experience_title`.
|
|
45
|
+
|
|
46
|
+
```sql
|
|
47
|
+
-- Group the events by experience and by step name.
|
|
48
|
+
-- PickedQL joins both `experiences` and `steps` for you.
|
|
49
|
+
SELECT experience_title, step_title, count(*)
|
|
50
|
+
FROM events
|
|
51
|
+
WHERE project_id = 'your-project-id'
|
|
52
|
+
GROUP BY experience_title, step_title
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
An automatic join also works inside a subquery and inside a common table expression.
|
|
56
|
+
Point at a dimension column where you need it, and PickedQL adds the `LEFT JOIN` at
|
|
57
|
+
that level:
|
|
58
|
+
|
|
59
|
+
```sql
|
|
60
|
+
-- Dimension columns inside a common table expression.
|
|
61
|
+
WITH per_step AS (
|
|
62
|
+
SELECT step_title, count(*) AS n
|
|
63
|
+
FROM events
|
|
64
|
+
WHERE project_id = 'your-project-id'
|
|
65
|
+
GROUP BY step_title
|
|
66
|
+
)
|
|
67
|
+
SELECT * FROM per_step ORDER BY n DESC
|
|
68
|
+
|
|
69
|
+
-- Dimension columns inside a nested query.
|
|
70
|
+
SELECT step_title, n FROM (
|
|
71
|
+
SELECT step_title, count(*) AS n FROM events
|
|
72
|
+
WHERE project_id = 'your-project-id'
|
|
73
|
+
GROUP BY step_title
|
|
74
|
+
) sub
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Native event columns
|
|
78
|
+
|
|
79
|
+
These columns are on `events` directly, and they need no join:
|
|
80
|
+
|
|
81
|
+
`event_type`, `interaction_type`, `experience_id`, `step_id`, `event_id`, `user_canonical_id`, `session_id`, `client_local_date`, `is_purchase`, `is_cart_add`, `event_meta`.
|
|
82
|
+
|
|
83
|
+
## Related
|
|
84
|
+
|
|
85
|
+
- [About PickedQL](/explanation/how-pickedql-works) — why you write no join.
|
|
86
|
+
- [Data sources](/reference/pickedql/data-sources)
|
|
87
|
+
- [Analytics queries](/how-to/analytics)
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
---
|
|
2
|
+
type: reference
|
|
2
3
|
layout: docs
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
#
|
|
6
|
+
# Filters
|
|
6
7
|
|
|
7
|
-
Add `WHERE`
|
|
8
|
+
Add a `WHERE` clause in the usual way. Every query must hold a `project_id` filter.
|
|
9
|
+
PickedQL reads that filter and checks that you have permission for the project.
|
|
10
|
+
PickedQL rejects a query with no `project_id` filter.
|
|
8
11
|
|
|
9
12
|
```sql
|
|
10
|
-
--
|
|
13
|
+
-- A range of dates.
|
|
11
14
|
SELECT control_users() FROM metrics
|
|
12
15
|
WHERE project_id = 'your-project-id'
|
|
13
16
|
AND project_local_date BETWEEN '2026-03-01' AND '2026-03-31'
|
|
14
17
|
|
|
15
|
-
-- By experience
|
|
18
|
+
-- By experience.
|
|
16
19
|
SELECT step_enter_users() FROM events
|
|
17
20
|
WHERE project_id = 'your-project-id'
|
|
18
21
|
AND experience_id = 'my-experience'
|
|
@@ -30,9 +33,11 @@ WHERE project_id = 'your-project-id'
|
|
|
30
33
|
Each query can only filter on a single `project_id`. Queries that reference multiple projects will be rejected.
|
|
31
34
|
:::
|
|
32
35
|
|
|
33
|
-
## Reference tables
|
|
36
|
+
## Reference tables, each with its own tenant filter
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
A query against a reference table needs its own tenant filter. The reference tables
|
|
39
|
+
are `steps`, `experiences`, and `projects`. The filter makes sure that you see only
|
|
40
|
+
the rows of a project that you can reach:
|
|
36
41
|
|
|
37
42
|
| Source | Tenant filter |
|
|
38
43
|
|---|---|
|
|
@@ -51,3 +56,9 @@ SELECT id, name, timezone FROM projects WHERE id = 'your-project-id'
|
|
|
51
56
|
```
|
|
52
57
|
|
|
53
58
|
The small lookup tables (`dim_variant`, `dim_device`, `dim_geo`, `dim_utm`, `dim_product`) are still exempt — they contain no tenant data.
|
|
59
|
+
|
|
60
|
+
## Related
|
|
61
|
+
|
|
62
|
+
- [Virtual functions](/reference/pickedql/virtual-functions) — the functions that take a
|
|
63
|
+
filter.
|
|
64
|
+
- [Analytics queries](/how-to/analytics)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PickedQL
|
|
7
|
+
|
|
8
|
+
PickedQL is a SQL query language for your Picked analytics data. Write short SQL with
|
|
9
|
+
a virtual table and a virtual function. PickedQL expands them into a full query, and
|
|
10
|
+
it adds the joins and the A/B test aggregations for you.
|
|
11
|
+
|
|
12
|
+
## Related
|
|
13
|
+
|
|
14
|
+
- [About PickedQL](/explanation/how-pickedql-works) — what the layer expands, and why a
|
|
15
|
+
tenant filter is required.
|
|
16
|
+
- [Analytics queries](/how-to/analytics) — worked examples.
|
|
17
|
+
- [Data sources](/reference/pickedql/data-sources) — every table.
|
|
18
|
+
- [Filters](/reference/pickedql/filtering) — the filter string a virtual function takes.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Schema
|
|
7
|
+
|
|
8
|
+
Column reference for each PickedQL data source.
|
|
9
|
+
|
|
10
|
+
## `metrics`
|
|
11
|
+
|
|
12
|
+
Pre-aggregated daily data. One row per unique combination of dimensions per day.
|
|
13
|
+
|
|
14
|
+
| Column | Type | Description |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `project_id` | `String` | Project identifier (required in `WHERE`) |
|
|
17
|
+
| `project_local_date` | `Date` | Date in project timezone |
|
|
18
|
+
| `experience_id` | `String` | Experience identifier |
|
|
19
|
+
| `step_id` | `String` | Step identifier |
|
|
20
|
+
| `event_type` | `String` | Event type (for example `page_view`, `click`) |
|
|
21
|
+
| `interaction_type` | `String` | Interaction type (for example `Button Click`) |
|
|
22
|
+
| `variant_type` | `String` | `Control`, `Variant`, or `Unknown` |
|
|
23
|
+
| `device_category` | `String` | Device category (for example `Desktop`, `Mobile`) |
|
|
24
|
+
| `country_code` | `String` | ISO country code |
|
|
25
|
+
| `utm_source` | `String` | UTM source |
|
|
26
|
+
| `utm_medium` | `String` | UTM medium |
|
|
27
|
+
| `product_name` | `String` | Product name |
|
|
28
|
+
| `product_category` | `String` | Product category |
|
|
29
|
+
| `landing_page_url` | `String` | Landing page URL |
|
|
30
|
+
|
|
31
|
+
:::note
|
|
32
|
+
Aggregate columns (`users`, `sessions`, `events`, and so on) are not queried directly — use [virtual functions](/reference/pickedql/virtual-functions) instead.
|
|
33
|
+
:::
|
|
34
|
+
|
|
35
|
+
## `events`
|
|
36
|
+
|
|
37
|
+
User-level event data. One row per event per user. Dimension columns are joined automatically when referenced.
|
|
38
|
+
|
|
39
|
+
### Native columns
|
|
40
|
+
|
|
41
|
+
| Column | Type | Description |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `project_id` | `String` | Project identifier (required in `WHERE`) |
|
|
44
|
+
| `event_id` | `String` | Unique event identifier |
|
|
45
|
+
| `user_canonical_id` | `String` | Canonical user identifier |
|
|
46
|
+
| `session_id` | `String` | Session identifier |
|
|
47
|
+
| `experience_id` | `String` | Experience identifier |
|
|
48
|
+
| `step_id` | `String` | Step identifier |
|
|
49
|
+
| `event_type` | `String` | Event type (for example `page_view`, `click`) |
|
|
50
|
+
| `interaction_type` | `String` | Interaction type (for example `Button Click`) |
|
|
51
|
+
| `client_local_date` | `Date` | Date in client timezone |
|
|
52
|
+
| `is_purchase` | `UInt8` | `1` if checkout complete event |
|
|
53
|
+
| `is_cart_add` | `UInt8` | `1` if cart add event |
|
|
54
|
+
| `is_first_session` | `UInt8` | `1` if first session for this user |
|
|
55
|
+
| `landing_page_url` | `String` | Landing page URL |
|
|
56
|
+
| `features` | Map(String, String) | Feature flag assignments |
|
|
57
|
+
| `feature_keys` | Map(String, String) | Feature key assignments |
|
|
58
|
+
| `event_meta` | `String` | Event metadata |
|
|
59
|
+
|
|
60
|
+
### Dimension columns (auto-joined)
|
|
61
|
+
|
|
62
|
+
These columns are joined automatically when referenced — no `JOIN` syntax needed.
|
|
63
|
+
|
|
64
|
+
| Column | Source | Description |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| `variant_type` | `dim_variant` | `Control`, `Variant`, or `Unknown` |
|
|
67
|
+
| `ab_feature_name` | `dim_variant` | A/B feature name |
|
|
68
|
+
| `ab_feature_value` | `dim_variant` | A/B feature value |
|
|
69
|
+
| `device_category` | `dim_device` | Device category |
|
|
70
|
+
| `browser_name` | `dim_device` | Browser name |
|
|
71
|
+
| `browser_version` | `dim_device` | Browser version |
|
|
72
|
+
| `os_name` | `dim_device` | The name of the operating system |
|
|
73
|
+
| `os_version` | `dim_device` | The version of the operating system |
|
|
74
|
+
| `platform` | `dim_device` | Platform |
|
|
75
|
+
| `country_code` | `dim_geo` | ISO country code |
|
|
76
|
+
| `country_name` | `dim_geo` | Country name |
|
|
77
|
+
| `region` | `dim_geo` | Region |
|
|
78
|
+
| `city` | `dim_geo` | City |
|
|
79
|
+
| `utm_source` | `dim_utm` | UTM source |
|
|
80
|
+
| `utm_medium` | `dim_utm` | UTM medium |
|
|
81
|
+
| `utm_campaign` | `dim_utm` | UTM campaign |
|
|
82
|
+
| `utm_term` | `dim_utm` | UTM term |
|
|
83
|
+
| `utm_content` | `dim_utm` | UTM content |
|
|
84
|
+
| `product_name` | `dim_product` | Product name |
|
|
85
|
+
| `product_category` | `dim_product` | Product category |
|
|
86
|
+
| `product_page` | `dim_product` | Product page |
|
|
87
|
+
| `step_title` | `steps` | Step title (joined on `project_id` + `experience_id` + `step_id`) |
|
|
88
|
+
| `experience_title` | `experiences` | Experience title (joined on `project_id` + `experience_id`) |
|
|
89
|
+
| `project_name` | `projects` | Project name |
|
|
90
|
+
| `project_timezone` | `projects` | Project timezone |
|
|
91
|
+
|
|
92
|
+
## `steps`, `experiences`, `projects`
|
|
93
|
+
|
|
94
|
+
These reference tables hold the configuration of your Picked project. PickedQL joins them
|
|
95
|
+
onto `events` when you point at one of their analyst-facing columns. Each one needs
|
|
96
|
+
its own tenant filter when you read it directly.
|
|
97
|
+
|
|
98
|
+
| Source | Real columns | Analyst columns, when you point at them from `events` | Tenant filter, when you read the table directly |
|
|
99
|
+
|---|---|---|---|
|
|
100
|
+
| `steps` | `id`, `title`, `experience_id`, `project_id`, `organization_id` | `step_title` | `project_id = '…'` |
|
|
101
|
+
| `experiences` | `id`, `title`, `project_id`, `organization_id` | `experience_title` | `project_id = '…'` |
|
|
102
|
+
| `projects` | `id`, `name`, `timezone`, `organization_id` | `project_name`, `project_timezone` | `id = '<project_id>'` |
|
|
103
|
+
|
|
104
|
+
When queried directly, use the real column names:
|
|
105
|
+
|
|
106
|
+
```sql
|
|
107
|
+
-- List all experiences for a project
|
|
108
|
+
SELECT id, title FROM experiences WHERE project_id = 'your-project-id'
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
When referenced from `events`, use the prefixed analyst names — joins are injected automatically:
|
|
112
|
+
|
|
113
|
+
```sql
|
|
114
|
+
SELECT experience_title, step_title, count(*)
|
|
115
|
+
FROM events
|
|
116
|
+
WHERE project_id = 'your-project-id'
|
|
117
|
+
GROUP BY experience_title, step_title
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## `features`
|
|
121
|
+
|
|
122
|
+
The `features` table gives you
|
|
123
|
+
[parameterized virtual functions](/reference/pickedql/virtual-functions#feature-functions-on-features-and-on-events).
|
|
124
|
+
Use them to read which visitors each feature flag holds:
|
|
125
|
+
|
|
126
|
+
| Function | Description |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `feature_users('name', 'bucket' [, 'key'])` | Unique users in a feature bucket |
|
|
129
|
+
| `feature_sessions('name', 'bucket' [, 'key'])` | Unique sessions in a feature bucket |
|
|
130
|
+
| `feature_events('name', 'bucket' [, 'key'])` | Unique events in a feature bucket |
|
|
131
|
+
|
|
132
|
+
## `experience_journey`
|
|
133
|
+
|
|
134
|
+
This table gives one edge for each step transition, and PickedQL aggregates them
|
|
135
|
+
first. Use the edges in a sankey chart or a funnel chart. Give each parameter in the
|
|
136
|
+
outer `WHERE` clause. PickedQL reads them and puts them into the query below.
|
|
137
|
+
|
|
138
|
+
### Columns
|
|
139
|
+
|
|
140
|
+
| Column | Type | Description |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| `source` | `String` | Edge start, formatted as `NN. <step title>` (for example `001. Welcome screen`) |
|
|
143
|
+
| `target` | `String` | Edge end, formatted as `NN. <step title>`.
|
|
144
|
+
| `users` | `UInt64` | Distinct `user_canonical_id` count that traversed this edge. |
|
|
145
|
+
|
|
146
|
+
### Parameters, in the `WHERE` clause
|
|
147
|
+
|
|
148
|
+
| Key | Type | Required | Purpose |
|
|
149
|
+
|---|---|---|---|
|
|
150
|
+
| `project_id` | `String` | ✓ | The tenant filter. |
|
|
151
|
+
| `experience_id` | `String` | | Limits the rows to one `fact_events.experience_id`. |
|
|
152
|
+
| `starting_step` | `String` | | Anchors each edge at the first time that a user reaches this `step_id`. The default is the first step of each user. |
|
|
153
|
+
| `targeting_step` | `String` | | Trims the window of each user at the first time that the user reaches this `step_id`. A user who never reaches it still gives the journey up to that point. |
|
|
154
|
+
| `num_nodes_after_start` | Integer | | The forward window from the start. It keeps a step where `seq_pos < start_seq + N`. |
|
|
155
|
+
| `num_nodes_before_target` | Integer | | The backward window from the target. It keeps a step where `seq_pos >= target_seq - N`. It needs `targeting_step`. |
|
|
156
|
+
| `top_n_path` | Integer | | Keeps the paths that the most users take, and drops the rest. The default is no limit. |
|
|
157
|
+
| `user_cohort_event` | `String` | | Limits the rows to a user with at least one `fact_events` row of this `event_type`. PickedQL writes it as `user_canonical_id IN (SELECT DISTINCT user_canonical_id FROM fact_events WHERE event_type = '…')`. |
|
|
158
|
+
| `client_local_date` | `Date` | | A filter on a range of dates. PickedQL puts it into the read below. It takes `=`, `<`, `<=`, `>`, `>=`, and `BETWEEN`. |
|
|
159
|
+
| `event_timestamp` | `DateTime64` | | A filter on the timestamp from the server. It takes the same operators as `client_local_date`. |
|
|
160
|
+
|
|
161
|
+
When you set both window parameters, both tests apply, and the result is their
|
|
162
|
+
intersection. A date filter joins the other parameters with `AND`.
|
|
163
|
+
|
|
164
|
+
See
|
|
165
|
+
[data sources, `experience_journey`](/reference/pickedql/data-sources#experience_journey--step-transitions-for-a-sankey-chart)
|
|
166
|
+
for examples.
|
|
167
|
+
|
|
168
|
+
## Related
|
|
169
|
+
|
|
170
|
+
- [Data sources](/reference/pickedql/data-sources)
|
|
171
|
+
- [Dimensions](/reference/pickedql/dimensions)
|
|
172
|
+
- [About PickedQL](/explanation/how-pickedql-works)
|