@picked/client 0.0.101-next.1 → 0.0.101-next.3

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.
Files changed (147) hide show
  1. package/README.md +34 -158
  2. package/dist/{api-DThEBKPu.cjs → api-9o_emCM5.cjs} +1 -1
  3. package/dist/{api-DcXndm41.js → api-BbQt8aW3.js} +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  6. package/dist/cjs/server/index.js +1 -1
  7. package/dist/esm/index.js +2 -2
  8. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  9. package/dist/esm/server/index.js +2 -2
  10. package/dist/{plugin-DA34qpbe.cjs → plugin-I8_6ncy_.cjs} +1 -1
  11. package/dist/{plugin-BZPx7WhX.js → plugin-uZJ45vK6.js} +2 -2
  12. package/dist/{preview-unavailable-sDBBJFrE.cjs → preview-unavailable-BUNxTYLe.cjs} +1 -1
  13. package/dist/{preview-unavailable-Bg8UuQeR.js → preview-unavailable-BYFD2a58.js} +1 -1
  14. package/dist/{provider-BkN7A93w.cjs → provider-Bzi_Kb-n.cjs} +1 -1
  15. package/dist/{provider-DRNHPacW.js → provider-CQKp0iUJ.js} +1 -1
  16. package/package.json +5 -5
  17. package/dist/docs/_root.css +0 -101
  18. package/dist/docs/explanation/conditions-and-the-logic-engine.md +0 -94
  19. package/dist/docs/explanation/content-references.md +0 -99
  20. package/dist/docs/explanation/feature-flag-allocation.md +0 -218
  21. package/dist/docs/explanation/how-picked-works.md +0 -124
  22. package/dist/docs/explanation/how-pickedql-works.md +0 -76
  23. package/dist/docs/explanation/pages-and-flows.md +0 -64
  24. package/dist/docs/explanation/the-content-model.md +0 -87
  25. package/dist/docs/explanation/the-two-apis.md +0 -68
  26. package/dist/docs/explanation/why-server-side-rendering.md +0 -76
  27. package/dist/docs/explanation/workspaces-and-versions.md +0 -71
  28. package/dist/docs/how-to/add-a-step-field-or-action.md +0 -43
  29. package/dist/docs/how-to/analytics/index.md +0 -316
  30. package/dist/docs/how-to/archive-or-delete-a-workspace.md +0 -46
  31. package/dist/docs/how-to/authenticate-the-cli.md +0 -101
  32. package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -47
  33. package/dist/docs/how-to/authenticate-with-a-password.md +0 -59
  34. package/dist/docs/how-to/authenticate-with-an-api-key.md +0 -51
  35. package/dist/docs/how-to/authenticate-with-oauth.md +0 -40
  36. package/dist/docs/how-to/build-a-flow.md +0 -93
  37. package/dist/docs/how-to/call-an-external-api-from-a-workflow.md +0 -102
  38. package/dist/docs/how-to/connect-the-mcp-server.md +0 -46
  39. package/dist/docs/how-to/create-a-content-entry.md +0 -48
  40. package/dist/docs/how-to/create-a-project.md +0 -29
  41. package/dist/docs/how-to/create-an-experience.md +0 -42
  42. package/dist/docs/how-to/create-and-revoke-an-api-key.md +0 -42
  43. package/dist/docs/how-to/debug-with-the-chrome-extension.md +0 -57
  44. package/dist/docs/how-to/define-a-page-layout.md +0 -46
  45. package/dist/docs/how-to/fill-and-publish-a-page.md +0 -66
  46. package/dist/docs/how-to/install-the-gtm-template.md +0 -84
  47. package/dist/docs/how-to/install-the-sdk.md +0 -93
  48. package/dist/docs/how-to/install-the-vite-plugin.md +0 -69
  49. package/dist/docs/how-to/invite-and-remove-members.md +0 -35
  50. package/dist/docs/how-to/point-one-entry-at-another.md +0 -61
  51. package/dist/docs/how-to/preview-a-workspace.md +0 -28
  52. package/dist/docs/how-to/publish-a-workspace.md +0 -30
  53. package/dist/docs/how-to/read-a-feature-flag.md +0 -113
  54. package/dist/docs/how-to/read-a-referenced-entry.md +0 -109
  55. package/dist/docs/how-to/register-a-component.md +0 -55
  56. package/dist/docs/how-to/register-an-action-handler.md +0 -85
  57. package/dist/docs/how-to/register-an-api-that-uses-oauth2.md +0 -107
  58. package/dist/docs/how-to/render-a-step-form.md +0 -131
  59. package/dist/docs/how-to/render-an-unpublished-preview.md +0 -41
  60. package/dist/docs/how-to/retry-a-failed-call-with-a-loop.md +0 -81
  61. package/dist/docs/how-to/reuse-a-section.md +0 -53
  62. package/dist/docs/how-to/reuse-a-step-field-or-action.md +0 -28
  63. package/dist/docs/how-to/roll-back-a-published-version.md +0 -26
  64. package/dist/docs/how-to/run-an-ab-test.md +0 -49
  65. package/dist/docs/how-to/run-code-on-a-form-submission.md +0 -125
  66. package/dist/docs/how-to/server-render-a-page.md +0 -81
  67. package/dist/docs/how-to/set-a-content-security-policy.md +0 -32
  68. package/dist/docs/how-to/set-up-mfa.md +0 -113
  69. package/dist/docs/how-to/switch-workspaces.md +0 -122
  70. package/dist/docs/how-to/upload-and-use-an-asset.mdx +0 -73
  71. package/dist/docs/how-to/validate-a-field.md +0 -52
  72. package/dist/docs/how-to/wait-for-an-action-response.md +0 -182
  73. package/dist/docs/how-to/write-a-condition.md +0 -45
  74. package/dist/docs/how-to/write-a-predicate.md +0 -60
  75. package/dist/docs/index.md +0 -59
  76. package/dist/docs/reference/dashboard/actions.mdx +0 -56
  77. package/dist/docs/reference/dashboard/api-keys.mdx +0 -38
  78. package/dist/docs/reference/dashboard/conditions.mdx +0 -42
  79. package/dist/docs/reference/dashboard/content/asset-library.mdx +0 -63
  80. package/dist/docs/reference/dashboard/content/blocks.mdx +0 -57
  81. package/dist/docs/reference/dashboard/content/content-entries.mdx +0 -95
  82. package/dist/docs/reference/dashboard/content/models.mdx +0 -108
  83. package/dist/docs/reference/dashboard/content/pages.mdx +0 -61
  84. package/dist/docs/reference/dashboard/experiences.mdx +0 -51
  85. package/dist/docs/reference/dashboard/external-apis.md +0 -169
  86. package/dist/docs/reference/dashboard/features.mdx +0 -154
  87. package/dist/docs/reference/dashboard/fields.mdx +0 -106
  88. package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +0 -58
  89. package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +0 -57
  90. package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +0 -72
  91. package/dist/docs/reference/dashboard/flow-builder/nodes.md +0 -63
  92. package/dist/docs/reference/dashboard/labels.md +0 -321
  93. package/dist/docs/reference/dashboard/lead-search.md +0 -224
  94. package/dist/docs/reference/dashboard/projects.mdx +0 -44
  95. package/dist/docs/reference/dashboard/reports.mdx +0 -43
  96. package/dist/docs/reference/dashboard/steps.mdx +0 -37
  97. package/dist/docs/reference/dashboard/team-management.md +0 -29
  98. package/dist/docs/reference/dashboard/workflow-runs.md +0 -142
  99. package/dist/docs/reference/dashboard/workflow-templates.md +0 -182
  100. package/dist/docs/reference/dashboard/workflow-test-runs.md +0 -77
  101. package/dist/docs/reference/dashboard/workspace-versioning.mdx +0 -30
  102. package/dist/docs/reference/dashboard/workspaces.mdx +0 -76
  103. package/dist/docs/reference/delivery-api/experience-content.md +0 -152
  104. package/dist/docs/reference/delivery-api/index.md +0 -45
  105. package/dist/docs/reference/delivery-api/preview-caching-crawling.md +0 -79
  106. package/dist/docs/reference/delivery-api/project-config.md +0 -65
  107. package/dist/docs/reference/delivery-api/workspace-schema.md +0 -107
  108. package/dist/docs/reference/glossary.md +0 -201
  109. package/dist/docs/reference/management-api/authentication.md +0 -87
  110. package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -291
  111. package/dist/docs/reference/management-api/error-handling.md +0 -232
  112. package/dist/docs/reference/management-api/pagination.md +0 -192
  113. package/dist/docs/reference/pickedql/data-sources.md +0 -174
  114. package/dist/docs/reference/pickedql/dimensions.md +0 -103
  115. package/dist/docs/reference/pickedql/filtering.md +0 -64
  116. package/dist/docs/reference/pickedql/index.md +0 -18
  117. package/dist/docs/reference/pickedql/schema.md +0 -172
  118. package/dist/docs/reference/pickedql/virtual-functions.md +0 -248
  119. package/dist/docs/reference/sdk/actions.md +0 -154
  120. package/dist/docs/reference/sdk/analytics-events.md +0 -453
  121. package/dist/docs/reference/sdk/conditions.md +0 -147
  122. package/dist/docs/reference/sdk/content-security-policy.md +0 -21
  123. package/dist/docs/reference/sdk/content.md +0 -253
  124. package/dist/docs/reference/sdk/experiences.md +0 -51
  125. package/dist/docs/reference/sdk/features.md +0 -256
  126. package/dist/docs/reference/sdk/fields.md +0 -255
  127. package/dist/docs/reference/sdk/index.md +0 -68
  128. package/dist/docs/reference/sdk/plugins/create-experience.md +0 -123
  129. package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +0 -74
  130. package/dist/docs/reference/sdk/plugins/index.md +0 -29
  131. package/dist/docs/reference/sdk/plugins/window-object.md +0 -25
  132. package/dist/docs/reference/sdk/predicates.md +0 -43
  133. package/dist/docs/reference/sdk/ssr/index.md +0 -33
  134. package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +0 -103
  135. package/dist/docs/reference/sdk/ssr/serialize.md +0 -80
  136. package/dist/docs/reference/sdk/ssr/slots-and-placements.md +0 -113
  137. package/dist/docs/reference/sdk/steps.md +0 -86
  138. package/dist/docs/reference/sdk/type-generation.md +0 -265
  139. package/dist/docs/reference/tools/chrome-extension.md +0 -16
  140. package/dist/docs/reference/tools/cli.md +0 -292
  141. package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
  142. package/dist/docs/reference/tools/mcp.md +0 -136
  143. package/dist/docs/reference/tools/vite-plugin.md +0 -163
  144. package/dist/docs/tutorials/first-api-call.md +0 -235
  145. package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +0 -143
  146. package/dist/docs/tutorials/first-experience.mdx +0 -254
  147. package/dist/docs/tutorials/first-server-rendered-page.mdx +0 -186
@@ -1,453 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Analytics events
7
-
8
- The Picked SDK sends an analytics event for each action of a visitor. This page names every
9
- event type, every interaction type, and every schema that the SDK sends.
10
-
11
- Two terms carry the page:
12
-
13
- - An **event type** is the name of the event. It is the `event_type` column in PickedQL.
14
- - A **context** is a block of data that the SDK attaches to an event. Picked makes a
15
- column from each one. An example is the `product_list` context behind `dim_product`.
16
-
17
- Every table below marks a context as **always attached** or as **attached when available**.
18
- The SDK attaches a context in the second group only when it has the data at that moment.
19
- An event outside an experience has no `experience` context.
20
-
21
- :::warning
22
- A PickedQL filter on a name that does not exist gives an empty result set and not an error.
23
- Take each name from this page.
24
- :::
25
-
26
- ## Contexts on every event
27
-
28
- The tracker attaches two contexts to every event: `app`, with the project ID, and
29
- `deployment`, with the environment of the SDK. It also attaches `cvly_x`, but only for a
30
- site on Vercel.
31
-
32
- The tables below never list `deployment` or `cvly_x`. They list `app` only where the
33
- tracker of that event attaches it a second time.
34
-
35
- ## Event types
36
-
37
- ### Experience events
38
-
39
- The analytics plugin sends these events. They come from the client SDK, and they need no
40
- code of yours.
41
-
42
- | Event type | When it fires | Always attached | Attached when available |
43
- | --- | --- | --- | --- |
44
- | `app_load` | The SDK loads on the page. | `feature_list`, `session` | `experience`, `step` |
45
- | `app_initialize` | The SDK completes its start-up and is ready. | `feature_list`, `session` | `experience`, `step` |
46
- | `experience_load` | An experience starts. | `experience`, `feature_list`, `session` | `step` |
47
- | `app_open` | An experience opens. | `feature_list`, `session` | `experience`, `step` |
48
- | `app_close` | An experience closes. | `feature_list`, `session` | `experience`, `step` |
49
- | `feature_decide` | A feature flag gets its bucket for this visitor. | `feature_list`, `session` | `experience`, `step` |
50
-
51
- An experience in an `<ExperienceSlot>` sends `experience_load` when the slot mounts it in
52
- the browser. The slot shows the experience when it is open and when it is closed:
53
-
54
- - With `open="rule"`, an experience that has no `initializeOpen` value does not open. It sends
55
- no `app_open`.
56
- - When the slot stops rendering an experience, the experience sends no `app_close`.
57
-
58
- See [Slots and Placements](/reference/sdk/ssr/slots-and-placements#lifecycle-events).
59
-
60
- ### Step and form events
61
-
62
- The analytics plugin sends `step_enter`, `step_submit`, `step_submit_success`,
63
- `form_submit`, `form_submit_success`, `form_submit_error`, and `field_validation_error`. The
64
- SDK has a tracker for `step_submit_error` and `step_complete`, but it starts neither of
65
- them. Call the tracker from your own code.
66
-
67
- | Event type | When it fires | Always attached | Attached when available |
68
- | --- | --- | --- | --- |
69
- | `step_enter` | The visitor arrives at a step of a flow. | `feature_list`, `session`, `step` | `experience`, `field_list` |
70
- | `step_submit` | The visitor submits a step. | `feature_list`, `session`, `step` | `experience`, `field_list`, `response_list` |
71
- | `step_submit_success` | The step submission is accepted. | `feature_list`, `session`, `step` | `experience`, `field_list`, `response_list` |
72
- | `step_submit_error` | A step submission fails. Your code sends it. | `exception`, `feature_list`, `session`, `step` | `experience`, `field_list`, `response_list` |
73
- | `step_complete` | A step reaches its end state. Your code sends it. | `feature_list`, `session`, `step` | `experience`, `field_list`, `response_list` |
74
- | `form_submit` | The visitor submits a form. | `feature_list`, `form`, `session` | `experience`, `step` |
75
- | `form_submit_success` | The form submission is accepted. | `feature_list`, `form`, `session` | `experience`, `step` |
76
- | `form_submit_error` | The form submission fails. The reason is in `exception`. | `exception`, `feature_list`, `form`, `session` | `experience`, `step` |
77
- | `field_validation_error` | A field value fails a validation rule. | `exception`, `feature_list`, `session` | `experience`, `form`, `step` |
78
-
79
- ### Ecommerce events
80
-
81
- Three sources send these events: the template for Google Tag Manager, the Picked app for
82
- Shopify, and your own code. The template for Google Tag Manager sends every event of this
83
- group. "Shopify behaviour" below covers the Picked app for Shopify.
84
-
85
- | Event type | When it fires | Always attached | Attached when available |
86
- | --- | --- | --- | --- |
87
- | `cart_add` | A product goes into the cart. | `app`, `feature_list`, `product_list`, `session` | `experience`, `step` |
88
- | `cart_remove` | A product leaves the cart. | `app`, `feature_list`, `product_list`, `session` | `experience`, `step` |
89
- | `checkout_start` | The visitor starts a checkout. | `app`, `feature_list`, `product_list`, `session` | `experience`, `step` |
90
- | `checkout_complete` | The visitor completes a checkout. It is the default conversion of PickedQL. | `app`, `feature_list`, `order`, `product_list`, `session` | `experience`, `step` |
91
- | `order_create` | An order becomes a record in the store. | `app`, `feature_list`, `order`, `product_list`, `session` | `experience`, `step` |
92
- | `product_list_view` | The visitor sees a list of products, such as a collection. | `app`, `feature_list`, `product_list`, `session` | `experience`, `step` |
93
- | `product_select` | The visitor chooses a product from a list. | `feature_list`, `product_list`, `session` | `experience`, `step` |
94
- | `product_view_details` | The visitor opens the detail page of a product. | `app`, `feature_list`, `product_list`, `session` | `experience`, `step` |
95
- | `search_results_list_view` | The visitor sees a list of search results. | `feature_list`, `product_list`, `session` | `experience`, `step` |
96
- | `recommendation_present` | A step shows a recommendation to the visitor. | `feature_list`, `product_list`, `session` | `experience`, `step` |
97
- | `wishlist_add` | A product goes onto a wishlist. | `feature_list`, `product_list`, `session` | `experience`, `step` |
98
- | `waitlist_join` | The visitor joins a waitlist. | `app`, `feature_list`, `session` | `experience`, `product_list`, `step` |
99
-
100
- `is_purchase` is 1 for `checkout_complete` and 0 for every other event. `is_cart_add` is 1
101
- for `cart_add`. Both columns are on `events` and on `metrics`.
102
-
103
- #### Shopify behaviour
104
-
105
- The Picked app for Shopify sends a part of this group from a web pixel, and one event from
106
- the server.
107
-
108
- | Picked event | Shopify source |
109
- | --- | --- |
110
- | `cart_add` | The `product_added_to_cart` pixel event. The `product_list` context holds the one cart line, and not the whole cart. |
111
- | `cart_remove` | The `product_removed_from_cart` pixel event, with the same one cart line. |
112
- | `checkout_start` | The `checkout_started` pixel event. The `session` context also gets `shopify_checkout_token`. |
113
- | `checkout_complete` | The `checkout_completed` pixel event. The `order` context is there only when the checkout has an order. |
114
- | `order_create` | The `orders/create` webhook, from the server and not the browser. The event time is the creation time of the order. |
115
- | `product_list_view` | The `collection_viewed` pixel event. |
116
- | `product_view_details` | The `product_viewed` pixel event, for one product variant. |
117
- | `page_view` | The `page_viewed` pixel event. |
118
- | `identify` | The `picked:session` pixel event. |
119
-
120
- For a Shopify store, the `session` context also holds `shopify_client_id`,
121
- `shopify_customer_id`, and `shopify_checkout_token`. The `order` context holds the Shopify
122
- `checkout_token` and `cart_token`. The Shopify pixel sends no other event type of this page.
123
-
124
- ### Page and session events
125
-
126
- | Event type | When it fires | Always attached | Attached when available |
127
- | --- | --- | --- | --- |
128
- | `page_view` | The visitor opens a page. | `app`, `feature_list`, `session` | `experience`, `product_list`, `step` |
129
- | `identify` | The SDK connects the session to a known person or store client. | `app`, `session` | `experience`, `feature_list`, `step` |
130
- | `lead_capture` | The visitor gives contact details. | `feature_list`, `session` | `experience`, `step` |
131
- | `lead_created` | The Picked API records the lead from a capture. | `app`, `session` | None. |
132
- | `modal_open` | A modal opens. | `feature_list`, `modal`, `session` | `experience`, `step` |
133
- | `modal_close` | A modal closes. | `feature_list`, `modal`, `session` | `experience`, `step` |
134
-
135
- ## Custom events
136
-
137
- A custom event takes its name from you, and not from the list above. Its `event_type` is
138
- the name that you give it, so a query for it uses that name.
139
-
140
- Two routes send one:
141
-
142
- - A `data-picked-<interaction>` attribute on an element. An element with
143
- `data-picked-click="add_to_cart"` sends an `add_to_cart` event on a click.
144
- - The `custom` message of the template for Google Tag Manager, with a name of your choice.
145
-
146
- A custom event always carries `app` and `session`. It also carries `element`, `exception`,
147
- `experience`, `feature_list`, `field_list`, `form`, `modal`, `order`, `product_list`,
148
- `response_list`, and `step` when the data is available.
149
-
150
- ## Interaction types
151
-
152
- An interaction event is a DOM event of the visitor. Its name is also an `event_type` value,
153
- so a query for a click reads `WHERE event_type = 'click'`.
154
-
155
- :::warning
156
- `interaction_type` in PickedQL is a different column. It holds the label of the element
157
- behind the event, and it falls back to `event_type` when the event has no element. A filter
158
- on `interaction_type = 'click'` therefore matches only the clicks with no label.
159
- :::
160
-
161
- ### Element interactions
162
-
163
- The SDK binds these listeners to an experience when the `enableInteractionListeners` option
164
- of the analytics plugin names them. The option is off by default.
165
-
166
- | Interaction type | When it fires | Always attached | Attached when available |
167
- | --- | --- | --- | --- |
168
- | `click` | The visitor clicks an element. | `element`, `feature_list`, `session` | `experience`, `step` |
169
- | `rapid_click` | The visitor clicks the same element many times in a short period. | `element`, `feature_list`, `session` | `experience`, `step` |
170
- | `right_click` | The visitor opens the context menu on an element. | `element`, `feature_list`, `session` | `experience`, `step` |
171
- | `copy` | The visitor copies a selection. | `feature_list`, `session` | `element`, `experience`, `step` |
172
- | `paste` | The visitor copies text into a field. | `feature_list`, `session` | `element`, `experience`, `step` |
173
- | `drag` | The visitor drags an element. | `feature_list`, `session` | `element`, `experience`, `step` |
174
- | `backspace` | The visitor deletes a character in a field. | `element`, `feature_list`, `session` | `experience`, `step` |
175
- | `scroll` | The visitor scrolls. | `feature_list`, `session` | `element`, `experience`, `step` |
176
- | `rapid_scroll` | The visitor scrolls up and down fast. | `feature_list`, `session` | `element`, `experience`, `step` |
177
- | `mouse_shake` | The visitor moves the pointer fast from side to side. | `feature_list`, `session` | `experience`, `step` |
178
-
179
- ### Page and network interactions
180
-
181
- The SDK binds these listeners to the document when the `enableDocumentListeners` option of
182
- the analytics plugin is true. The option is off by default.
183
-
184
- | Interaction type | When it fires | Always attached | Attached when available |
185
- | --- | --- | --- | --- |
186
- | `page_visible` | The page becomes visible, such as a return to the tab. | `feature_list`, `session` | `experience`, `step` |
187
- | `page_hidden` | The page stops to be visible. | `feature_list`, `session` | `experience`, `step` |
188
- | `page_show` | The browser shows the page, and also on a return from the cache. | `feature_list`, `session` | `experience`, `step` |
189
- | `page_hide` | The browser hides the page before the visitor goes to a different page. | `feature_list`, `session` | `experience`, `step` |
190
- | `offline` | The browser loses the network. | `feature_list`, `session` | `experience`, `step` |
191
- | `online` | The browser gets the network back. | `feature_list`, `session` | `experience`, `step` |
192
- | `resize` | The window changes size. | `feature_list`, `session` | `experience`, `step` |
193
- | `unload` | The browser closes the document. | `feature_list`, `session` | `experience`, `step` |
194
-
195
- ### Interactions with no listener
196
-
197
- The SDK declares these two types and sends none of them, because it binds no listener for
198
- them. A query on one of them gives an empty result set.
199
-
200
- | Interaction type | When it fires | Always attached | Attached when available |
201
- | --- | --- | --- | --- |
202
- | `back` | Nothing sends it. | `feature_list`, `session` | `experience`, `step` |
203
- | `forward` | Nothing sends it. | `feature_list`, `session` | `experience`, `step` |
204
-
205
- ## Schemas
206
-
207
- Each context has a schema. Every schema also accepts a `meta` object for data of your own,
208
- and keeps a property that the schema does not name. The field tables below do not repeat
209
- `meta`.
210
-
211
- | Schema | What it describes |
212
- | --- | --- |
213
- | `answer_list` | The responses of a visitor, under the earlier name of `response_list`. The SDK attaches `response_list`. |
214
- | `app` | The Picked project that the event belongs to. |
215
- | `cvly_funnel` | The version of a Convincely funnel. The SDK attaches it for no event. |
216
- | `cvly_x` | The Vercel deployment behind the site. |
217
- | `deployment` | The deployment and the environment of the SDK. |
218
- | `element` | The HTML element behind an interaction event. |
219
- | `event` | The event itself. It is not a context: it holds the event type and the `event_meta` column. |
220
- | `exception` | The reason for a failure or a validation error. |
221
- | `experience` | The experience that the visitor is in. |
222
- | `feature_list` | Each feature flag of the session, with the bucket of the visitor. |
223
- | `field_list` | The fields of the current step, with their options. |
224
- | `form` | The form behind a form event. |
225
- | `modal` | The modal behind a modal event. |
226
- | `order` | The order behind a purchase. |
227
- | `picked` | The SDK version. The SDK attaches it for no event. |
228
- | `product_list` | The products that the event is about. |
229
- | `question_list` | The fields of a step, under the earlier name of `field_list`. The SDK attaches `field_list`. |
230
- | `recommendation_list` | A list of recommended items. The SDK attaches it for no event. |
231
- | `response_list` | The response of the visitor to each field. |
232
- | `session` | The session, and each identifier that Picked has for it. |
233
- | `step` | The step of the flow that the visitor is on. |
234
-
235
- ### `app`
236
-
237
- | Field | Type | Required | Description |
238
- | --- | --- | --- | --- |
239
- | `project_id` | `string` | Yes | The project ID. |
240
-
241
- ### `deployment`
242
-
243
- | Field | Type | Required | Description |
244
- | --- | --- | --- | --- |
245
- | `env` | `string` | Yes | The environment of the deployment. |
246
- | `id` | `string` or `null` | No | The deployment ID. |
247
- | `sha` | `string` or `null` | No | The Git hash of the deployment. |
248
- | `host` | `string` or `null` | No | The host of the deployment. |
249
-
250
- ### `cvly_x`
251
-
252
- | Field | Type | Required | Description |
253
- | --- | --- | --- | --- |
254
- | `vercel_deployment_id` | `string` | Yes | The Vercel deployment ID. |
255
- | `vercel_env` | `string` | Yes | The Vercel environment. |
256
- | `vercel_url` | `string` | Yes | The URL of the Vercel deployment. |
257
- | `git_commit_sha` | `string` or `null` | No | The Git hash of the deployment. |
258
-
259
- ### `session`
260
-
261
- The `session` schema has no required field. A value is `null` until Picked has it.
262
-
263
- | Field | Type | Required | Description |
264
- | --- | --- | --- | --- |
265
- | `id` | `string` or `null` | No | The session ID. |
266
- | `is_user` | `boolean` or `null` | No | True when Picked attributes the session to a known user. |
267
- | `gaid` | `string` or `null` | No | The client ID from Google Analytics. |
268
- | `shopify_client_id` | `string` or `null` | No | The Shopify client ID. |
269
- | `shopify_customer_id` | `string` or `null` | No | The Shopify customer ID. |
270
- | `shopify_checkout_token` | `string` or `null` | No | The Shopify checkout token. |
271
- | `fingerprintjs_visitor_id` | `string` or `null` | No | The FingerprintJS visitor ID. |
272
-
273
- ### `experience`
274
-
275
- | Field | Type | Required | Description |
276
- | --- | --- | --- | --- |
277
- | `id` | `string` | Yes | The experience ID. |
278
- | `title` | `string` | Yes | The experience title. It is `experience_title` in PickedQL. |
279
- | `type` | `string` or `null` | No | The experience type. |
280
-
281
- ### `step`
282
-
283
- | Field | Type | Required | Description |
284
- | --- | --- | --- | --- |
285
- | `id` | `string` | Yes | The step ID. It is `step_id` in PickedQL. |
286
- | `title` | `string` | Yes | The step title. It is `step_title` in PickedQL. |
287
- | `key` | `string` or `null` | No | The stable key of the step. It does not change between versions. |
288
-
289
- ### `feature_list`
290
-
291
- `items` is a list. Each item describes one feature flag of the session.
292
-
293
- | Field | Type | Required | Description |
294
- | --- | --- | --- | --- |
295
- | `items` | `array` | Yes | One entry for each feature flag. |
296
- | `items[].ab_feature` | `string` | Yes | The feature ID. |
297
- | `items[].ab_name` | `string` | Yes | The feature name. It is `ab_feature_name` in PickedQL. |
298
- | `items[].ab_key` | `string` | Yes | The feature key. |
299
- | `items[].ab_bucket` | `boolean` or `string` | Yes | The bucket of the visitor. It is `ab_feature_value` in PickedQL. |
300
-
301
- ### `field_list`
302
-
303
- | Field | Type | Required | Description |
304
- | --- | --- | --- | --- |
305
- | `items` | `array` | Yes | One entry for each field of the step. |
306
- | `items[].id` | `string` | Yes | The field ID. |
307
- | `items[].type` | `string` | Yes | The field type. |
308
- | `items[].label` | `string` | Yes | The field label. |
309
- | `items[].options` | `array` or `null` | No | The options that the field gives. |
310
- | `items[].options[].id` | `string` | Yes | The option ID. |
311
- | `items[].options[].label` | `string` | Yes | The option label. |
312
- | `items[].options[].value` | `string`, `number`, `boolean`, `object`, `array`, or `null` | Yes | The value behind the option. |
313
-
314
- ### `response_list`
315
-
316
- | Field | Type | Required | Description |
317
- | --- | --- | --- | --- |
318
- | `items` | `array` | Yes | One entry for each field with a response. |
319
- | `items[].field_id` | `string` | Yes | The ID of the field. |
320
- | `items[].values` | `array` | Yes | The values that the visitor gave. |
321
- | `items[].values[].value` | `string`, `number`, `boolean`, `object`, `array`, or `null` | Yes | One response value. |
322
-
323
- ### `form`
324
-
325
- | Field | Type | Required | Description |
326
- | --- | --- | --- | --- |
327
- | `id` | `string` | Yes | The form ID. |
328
- | `title` | `string` or `null` | No | The form title. |
329
-
330
- ### `modal`
331
-
332
- | Field | Type | Required | Description |
333
- | --- | --- | --- | --- |
334
- | `id` | `string` | Yes | The modal ID. |
335
- | `title` | `string` | Yes | The modal title. |
336
-
337
- ### `element`
338
-
339
- | Field | Type | Required | Description |
340
- | --- | --- | --- | --- |
341
- | `node_type` | `string` | Yes | The HTML tag name in lower case. It is `unknown` when the event has no element. |
342
- | `id` | `string` or `null` | No | The `id` attribute of the element. |
343
- | `text` | `string` or `null` | No | The text content of the element, to 255 characters. |
344
- | `label` | `string` or `null` | No | The label of the element. It is the source of `interaction_type` in PickedQL. |
345
-
346
- ### `exception`
347
-
348
- | Field | Type | Required | Description |
349
- | --- | --- | --- | --- |
350
- | `reason` | `string` | Yes | The reason for the failure. |
351
-
352
- ### `product_list`
353
-
354
- `items` follows the item format of GA4 Enhanced Ecommerce, so a variable in Google Tag
355
- Manager maps onto it directly. Every item field accepts `null`.
356
-
357
- | Field | Type | Required | Description |
358
- | --- | --- | --- | --- |
359
- | `items` | `array` | Yes | One entry for each product. |
360
- | `title` | `string` or `null` | No | The title of the list. |
361
- | `items[].item_id` | `string` or `null` | No | The product ID. It is `product_name` in `dim_product` together with the name. |
362
- | `items[].item_name` | `string` or `null` | No | The product name. |
363
- | `items[].item_brand` | `string` or `null` | No | The brand. |
364
- | `items[].item_category` | `string` or `null` | No | The category. `item_category2` to `item_category5` hold the deeper levels. |
365
- | `items[].item_variant` | `string` or `null` | No | The variant. |
366
- | `items[].item_list_id` | `string` or `null` | No | The ID of the list that the product came from. |
367
- | `items[].item_list_name` | `string` or `null` | No | The name of that list. |
368
- | `items[].price` | `number` or `null` | No | The price of one item. |
369
- | `items[].quantity` | `number` or `null` | No | The quantity. |
370
- | `items[].discount` | `number` or `null` | No | The discount on the item. |
371
- | `items[].currency` | `string` or `null` | No | The currency code. |
372
- | `items[].coupon` | `string` or `null` | No | The coupon code. |
373
- | `items[].affiliation` | `string` or `null` | No | The store behind the order. |
374
- | `items[].index` | `number` or `null` | No | The position of the product in the list. |
375
- | `items[].location_id` | `string` or `null` | No | The location of the store. |
376
- | `items[].promotion_id` | `string` or `null` | No | The promotion ID. |
377
- | `items[].promotion_name` | `string` or `null` | No | The promotion name. |
378
- | `items[].creative_name` | `string` or `null` | No | The creative name. |
379
- | `items[].creative_slot` | `string` or `null` | No | The creative slot. |
380
- | `items[].in_stock` | `boolean` or `null` | No | True when the product is in stock. |
381
-
382
- ### `order`
383
-
384
- | Field | Type | Required | Description |
385
- | --- | --- | --- | --- |
386
- | `id` | `string` | Yes | The order ID. It is `order_id` in PickedQL. |
387
- | `customer_id` | `string` or `null` | No | The customer ID in the store. |
388
- | `checkout_token` | `string` or `null` | No | The checkout token in the store. |
389
- | `cart_token` | `string` or `null` | No | The cart token in the store. |
390
-
391
- ### `event`
392
-
393
- The event schema wraps every event, and it is not a context.
394
-
395
- | Field | Type | Required | Description |
396
- | --- | --- | --- | --- |
397
- | `type` | `string` | Yes | The event type. It is `event_type` in PickedQL. |
398
-
399
- The `meta` object of this schema is the `event_meta` column in PickedQL.
400
-
401
- ### `recommendation_list`
402
-
403
- | Field | Type | Required | Description |
404
- | --- | --- | --- | --- |
405
- | `title` | `string` | Yes | The title of the list. |
406
- | `items` | `array` | Yes | One entry for each recommended item. |
407
- | `items[].sku` | `string` | Yes | The SKU of the item. |
408
- | `items[].title` | `string` | Yes | The title of the item. |
409
-
410
- ### `question_list`
411
-
412
- `question_list` is the earlier name of `field_list`, and it has the same shape. On an item
413
- and on an option, `title` takes the place of `label`.
414
-
415
- | Field | Type | Required | Description |
416
- | --- | --- | --- | --- |
417
- | `items` | `array` | Yes | One entry for each question. |
418
- | `items[].id` | `string` | Yes | The question ID. |
419
- | `items[].type` | `string` | Yes | The question type. |
420
- | `items[].title` | `string` | Yes | The question title. |
421
- | `items[].options` | `array` or `null` | No | The options that the question gives. |
422
-
423
- ### `answer_list`
424
-
425
- `answer_list` is the earlier name of `response_list`, and it has the same shape.
426
-
427
- | Field | Type | Required | Description |
428
- | --- | --- | --- | --- |
429
- | `items` | `array` | Yes | One entry for each question with an answer. |
430
- | `items[].question_id` | `string` | Yes | The ID of the question. |
431
- | `items[].values` | `array` | Yes | The values that the visitor gave. |
432
- | `items[].values[].value` | `string`, `number`, `boolean`, `object`, `array`, or `null` | Yes | One answer value. |
433
-
434
- ### `cvly_funnel`
435
-
436
- | Field | Type | Required | Description |
437
- | --- | --- | --- | --- |
438
- | `version` | `string` | Yes | The version of the funnel. |
439
-
440
- ### `picked`
441
-
442
- | Field | Type | Required | Description |
443
- | --- | --- | --- | --- |
444
- | `sdk_version` | `string` | Yes | The version of the SDK. |
445
-
446
- ## Related
447
-
448
- - [Dimension columns](/reference/pickedql/dimensions) — the columns that come from these
449
- contexts.
450
- - [Schema](/reference/pickedql/schema) — the columns of `events` and of `metrics`.
451
- - [Run an analytics query](/how-to/analytics) — a query for each common question.
452
- - [Install the GTM template](/how-to/install-the-gtm-template) — how to send an ecommerce
453
- event from Google Tag Manager.
@@ -1,147 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Conditions
7
-
8
- A condition uses JSON Logic to evaluate the client state. Use a condition to control
9
- when an experience starts, to choose the next step, and to show or hide a field.
10
-
11
- ## Conditions in experiences
12
-
13
- A common pattern puts a condition between two steps. The flow then takes a branch
14
- that the form responses decide:
15
-
16
- ```ts
17
- import { createExperience } from '@picked/client/plugins/create-experience'
18
-
19
- const questionaireFunnel = createExperience({
20
- id: 'mini-funnel',
21
- // experience config
22
- })
23
-
24
- const userInformationStep = funnel.addStep({
25
- fields: ['email-address-field', 'sign-up-for-newsletter-field'],
26
- })
27
- const signUserUpToNewsletter = funnel.addStep({
28
- // step config
29
- })
30
- const userDoesNotWantNewsletter = funnel.addStep({
31
- // step config
32
- })
33
-
34
- const isSigningUpForNewsletter = funnel.addConditional({
35
- condition: {
36
- '==': [
37
- {
38
- var: 'responses.sign-up-for-newsletter-field',
39
- },
40
- true,
41
- ],
42
- },
43
- })
44
-
45
- userInformationStep.nextConditional(isSigningUpForNewsletter)
46
-
47
- isSigningUpForNewsletter.addTrue(signUserUpToNewsletter)
48
- isSigningUpForNewsletter.addFalse(userDoesNotWantNewsletter)
49
- ```
50
-
51
- ## Conditional fields
52
-
53
- A JSON Logic condition can show or hide a field. The condition can read an earlier
54
- response or a [predicate](/reference/sdk/predicates):
55
-
56
- ```ts
57
- import { createField } from '@picked/client/plugins/create-experience'
58
-
59
- // Show the email field only when the user chose "email" as a contact method.
60
- export const emailField = createField({
61
- id: 'email-input',
62
- name: 'email-input',
63
- type: 'text',
64
- label: 'Email Address',
65
- multiple: false,
66
- required: true,
67
- condition: {
68
- in: [
69
- 'email',
70
- {
71
- var: 'responses.communication-methods',
72
- },
73
- ],
74
- },
75
- })
76
-
77
- // Show the field when the predicate returns true.
78
- export const mailingAddressField = createField({
79
- id: 'mailing-address',
80
- name: 'mailing-address',
81
- type: 'text',
82
- label: 'Mailing Address',
83
- multiple: false,
84
- required: true,
85
- condition: {
86
- '==': [
87
- {
88
- invoke: {
89
- var: 'predicates.user-allows-mail',
90
- },
91
- },
92
- true,
93
- ],
94
- },
95
- })
96
- ```
97
-
98
- ## Field options with conditions
99
-
100
- Individual options within a field can also have conditional visibility:
101
-
102
- ```ts
103
- import { createField } from '@picked/client/plugins/create-experience'
104
-
105
- export const contactMethodsField = createField({
106
- id: 'contact-methods',
107
- name: 'contact-methods',
108
- type: 'text',
109
- label: 'How should we contact you?',
110
- multiple: true,
111
- required: true,
112
- options: [
113
- {
114
- id: 'email',
115
- label: 'Email',
116
- value: 'email',
117
- },
118
- {
119
- id: 'phone',
120
- label: 'Phone',
121
- value: 'phone',
122
- },
123
- {
124
- id: 'mail',
125
- label: 'Postal Mail',
126
- value: 'mail',
127
- // Only show this option if user has a verified address
128
- condition: {
129
- '==': [
130
- {
131
- invoke: {
132
- var: 'predicates.has-verified-address',
133
- },
134
- },
135
- true,
136
- ],
137
- },
138
- },
139
- ],
140
- })
141
- ```
142
-
143
- ## Related
144
-
145
- - [About conditions and the logic engine](/explanation/conditions-and-the-logic-engine)
146
- - [How to write a condition](/how-to/write-a-condition)
147
- - [Predicates](/reference/sdk/predicates)
@@ -1,21 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Content Security Policy
7
-
8
- The Picked SDK loads resources from the domains below. Add each domain to the CSP
9
- directive that the table gives.
10
-
11
- ## Required domains
12
-
13
- | Domain | Directive | Purpose |
14
- | --- | --- | --- |
15
- | `api.picked.app` | `connect-src` | API requests, project configuration, experiences, and the record of each session |
16
- | `evnts.pckd.dev` | `connect-src` | Analytics events, which Snowplow collects |
17
- | `img.picked-content.com` | `img-src` | Optimised images, which the [image optimisation service](/reference/tools/image-optimisation-service) serves |
18
-
19
- ## Related
20
-
21
- - [How to set a Content Security Policy](/how-to/set-a-content-security-policy)