@pomeloanalytics/api 0.1.0-beta.2 → 0.1.0-beta.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-beta.4
4
+
5
+ - Sync the reviewed public contract for a single audience measurement and the
6
+ Campagnes option. Availability statuses `locked_by_profile` and
7
+ `partially_available_after_effective_at`, the reasons `strict_safe_route`,
8
+ `extended_data_required` and `requested_period_crosses_profile_change`, and
9
+ the availability fields `currentProfile`, `classification`, `readModel` and
10
+ `collectionProfileEffectiveAt` are removed. Reasons are now
11
+ `campaigns_option_required`, `outside_source_coverage` or `null`.
12
+ - Acquisition responses add `campaigns_enabled`, `consented_sessions` and the
13
+ `contents` and `terms` dimensions, and drop the `tagged_*` coverage fields.
14
+ - Rates, shares and means are `number | null` (null under 10 contributors);
15
+ envelopes may carry `small_site`.
16
+ - `meta.surface.reportingPrecision` is
17
+ `{ version: 'exact-masked-counts-v1', minimumCount: 10, rateStep: 0.01 }`:
18
+ counts are exact from 10 and `null` from 1 to 9 (never 0, never 5; render as
19
+ `< 10`). Rates, means and p75 are `null` under 10 contributors; `delta` and
20
+ `delta_pct` are published only when both counts are.
21
+ - Timeseries responses add `period_total`; Acquisition details add the
22
+ `referrer_sources` and `referrer_types` dimensions; Content `include` no
23
+ longer accepts `details` (`summary` or `full`).
24
+ - `small_site.reason` (`small_site` or `filter_complement`) says why the
25
+ totals come from a wider period: too few visits, or a filter that sets 1 to
26
+ 9 visits of the site apart (its rates and means are then null).
27
+ - Report filters accept only values published for the period (10 visits or
28
+ more); others are refused with 422 `INVALID_PARAMS`
29
+ (`reason: filter_value_not_published`).
30
+ - The HTTP client implementation is unchanged.
31
+
32
+ ## 0.1.0-beta.3
33
+
34
+ - Add optional per-metric Content sample counts and the selected measurement method to generated API types.
35
+ - Preserve missing, zero and sparse observations without client-side aggregation or default values.
36
+ - Keep the HTTP client implementation, server-side token boundary and request behavior unchanged.
37
+
3
38
  ## 0.1.0-beta.2
4
39
 
5
40
  - Add the product website, documentation links and relevant npm keywords.
package/README.md CHANGED
@@ -51,8 +51,8 @@ const { data: account } = await pomelo.me();
51
51
 
52
52
  Create a read token in the Pomelo dashboard as described in the getting-started
53
53
  guide. Keep it in server configuration, outside source control and browser code.
54
- API access depends on your plan and the token's permissions. The API enforces
55
- collection-profile availability for each endpoint.
54
+ API access depends on your plan and the token's permissions. Each report
55
+ returns `availability`, which tells you whether the requested period is covered.
56
56
 
57
57
  ## Read metrics
58
58
 
@@ -107,7 +107,16 @@ Response fields are never renamed.
107
107
  Dates use inclusive UTC `YYYY-MM-DD` values. Pass explicit dates to bound a read.
108
108
  The server owns defaults, period validation, entitlements, and numeric limits;
109
109
  the SDK does not choose content depth, clamp limits, or change a requested range.
110
- The `details` alias for content `include` remains accepted by the public contract.
110
+ Content `include` accepts `summary` or `full`.
111
+
112
+ Full Content responses can include `current.metric_method` and
113
+ `current.pages[].performance.n_lcp`, `n_fcp`, `n_inp`, `n_cls` and `n_ttfb`.
114
+ These optional fields identify the selected measurement method and each metric's
115
+ own observation count. `samples` remains the combined event count; it does not
116
+ establish coverage for every metric. The client preserves missing counts, zero
117
+ counts and null values without recomputing percentiles or filling defaults.
118
+ Browser performance collection is performed by the separate tracking script.
119
+
111
120
 
112
121
  Acquisition has three distinct response shapes. The SDK forwards `include`
113
122
  unchanged and returns the complete response without renaming one shape into another.
@@ -136,8 +145,9 @@ if ('channels' in data.current) {
136
145
  }
137
146
  ```
138
147
 
139
- For Acquisition, `details` is a distinct shape. For Content, `details` is the
140
- deprecated alias for `full`. Actions accepts `summary`, `full`, and `details`
148
+ For Acquisition, `details` is a distinct shape (it adds the `referrer_sources`
149
+ and `referrer_types` dimensions). Content accepts only `summary` and `full`.
150
+ Actions accepts `summary`, `full`, and `details`
141
151
  using its single response schema; summary leaves detail lists empty on the server.
142
152
  Omitting `include` leaves the server's selection unchanged.
143
153
 
@@ -160,7 +170,7 @@ if ('dimensions' in data.current && data.current.impact) {
160
170
  }
161
171
  ```
162
172
 
163
- Impact is conditional on the server response and Extended data. It reports
173
+ Impact is conditional on the server response and on the Campagnes option. It reports
164
174
  distinct converted visits using first-pageview attribution; repeated goal
165
175
  matches count once. Check availability as well as the optional impact object.
166
176
  The SDK supplies no impact defaults or enrichment.
@@ -178,11 +188,28 @@ curl --get 'https://api.pomeloanalytics.com/v1/reports/acquisition' \
178
188
  --data-urlencode 'goal_id=goal-test'
179
189
  ```
180
190
 
181
- HTTP 200 on a mixed route means its strict-safe baseline succeeded. Check
182
- `availability.sections` for sections that remain locked or only partially
183
- available. Tenant-scoped reads use a stable opaque `tenantId`; the server checks
191
+ Check `availability.sections` for sections that are unavailable or only
192
+ partially available: `reason` is `campaigns_option_required` when the Campagnes
193
+ option is off, `outside_source_coverage` when the period is not covered, or
194
+ `null`. Tenant-scoped reads use a stable opaque `tenantId`; the server checks
184
195
  the token's permissions and the site's configuration.
185
196
 
197
+ ## Reporting precision
198
+
199
+ `meta.surface.reportingPrecision` is
200
+ `{ version: 'exact-masked-counts-v1', minimumCount: 10, rateStep: 0.01 }`.
201
+ Counts are exact from 10. A count from 1 to 9 is published as `null`: display
202
+ it as `< 10`. It is never `0` and never a representative value such as 5.
203
+ `0` is a measured zero. Rates, shares, means and p75 values are `null` under 10
204
+ contributors. `delta` and `delta_pct` are published only when both counts are.
205
+ `timeseries` responses carry `period_total`, which is `null` when masked.
206
+
207
+ The SDK returns these values unchanged: it does not retry, round or rebuild
208
+ anything. A masked value stays `null`: never add it up, subtract it or compute
209
+ a gap from it. A missing observation is signalled by the field or the
210
+ availability state of the section, not by a number. Responses may also carry
211
+ `small_site`.
212
+
186
213
  ## Errors and request metadata
187
214
 
188
215
  HTTP failures throw `PomeloApiError`, exposing `status`, `code`, `requestId`, and