@koda-sl/baker-cli 0.298.0 → 0.299.0

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/cli.js CHANGED
@@ -13963,9 +13963,27 @@ var analyticsLandingRowSchema = z28.object({
13963
13963
  /** Sessions that BEGAN here. The honest denominator for this page's rate. */
13964
13964
  entrances: z28.number().int().nonnegative(),
13965
13965
  visitors: z28.number().int().nonnegative(),
13966
+ /**
13967
+ * Conversions that fired ON this landing — rarely the number to show.
13968
+ *
13969
+ * A landing's outcome usually happens somewhere else: the client's checkout,
13970
+ * their shop, a CRM days later. None of those rows carries a landing id, so
13971
+ * this reads 0 for a page whose visits convert reliably.
13972
+ */
13966
13973
  conversions: z28.number().int().nonnegative(),
13967
13974
  /** Visits that converted on this page at least once. */
13968
13975
  convertingSessions: z28.number().int().nonnegative(),
13976
+ /**
13977
+ * Conversions the attribution model credited to this landing — what the page
13978
+ * is bought for, and what {@link conversionRate} is built from.
13979
+ *
13980
+ * Last non-direct click over a 90-day lookback, resolved per person, so it
13981
+ * includes the sale a returning visitor made next week and the deal a CRM
13982
+ * posted with no cookie at all.
13983
+ */
13984
+ creditedConversions: z28.number().int().nonnegative(),
13985
+ /** People whose credited touch arrived here and who then converted. */
13986
+ creditedVisitors: z28.number().int().nonnegative(),
13969
13987
  outboundClicks: z28.number().int().nonnegative(),
13970
13988
  /**
13971
13989
  * Converting visits per entrance. Null when nobody entered here at all.
@@ -14090,9 +14108,25 @@ var analyticsPageRowSchema = z28.object({
14090
14108
  pageViews: z28.number().int().nonnegative(),
14091
14109
  /** Sessions that began on this page — its value as a landing page. */
14092
14110
  entrances: z28.number().int().nonnegative(),
14111
+ /**
14112
+ * Conversions that fired ON this page — "which page converts".
14113
+ *
14114
+ * Almost never the number to put beside Entrances. A landing page's job is to
14115
+ * start a visit that converts, and the conversion is usually somewhere else:
14116
+ * the shop, the checkout, a CRM a week later. Read alone this makes every
14117
+ * landing page of a real funnel report zero.
14118
+ */
14093
14119
  conversions: z28.number().int().nonnegative(),
14094
14120
  /** Visits that converted on this page at least once. */
14095
14121
  convertingSessions: z28.number().int().nonnegative(),
14122
+ /**
14123
+ * Conversions the attribution model credited to this page — last non-direct
14124
+ * click, 90-day lookback, resolved per person. The number a landing-page
14125
+ * table means by "conversions", and the one the rate is built from.
14126
+ */
14127
+ creditedConversions: z28.number().int().nonnegative(),
14128
+ /** People whose credited touch arrived here and who then converted. */
14129
+ creditedVisitors: z28.number().int().nonnegative(),
14096
14130
  /** Converting visits per entrance, 0–1. Null when nobody landed here. */
14097
14131
  conversionRate: z28.number().min(0).max(1).nullable(),
14098
14132
  avgEngagementMs: z28.number().nonnegative().nullable()
@@ -14861,6 +14895,13 @@ var analyticsVisitorRowSchema = z28.object({
14861
14895
  identityHash: z28.string(),
14862
14896
  identityKind: z28.string()
14863
14897
  });
14898
+ var analyticsMeasureScopeSchema = z28.object({
14899
+ scope: z28.enum(["campaigns", "outcomes", "all", "unknown"]),
14900
+ /** Every event the tag on the client's own site sent in this window. */
14901
+ websiteEvents: z28.number(),
14902
+ /** Browser ids it minted off-Baker. Any at all means the tag is on `all`. */
14903
+ websiteNewVisitors: z28.number()
14904
+ });
14864
14905
  var analyticsQueryDataSchema = z28.object({
14865
14906
  preset: analyticsPresetSchema,
14866
14907
  window: analyticsWindowSchema,
@@ -14877,6 +14918,7 @@ var analyticsQueryDataSchema = z28.object({
14877
14918
  triggers: z28.array(analyticsTriggerRowSchema).optional(),
14878
14919
  releases: z28.array(analyticsReleaseRowSchema).optional(),
14879
14920
  paid: z28.array(analyticsPaidRowSchema).optional(),
14921
+ measureScope: analyticsMeasureScopeSchema.optional(),
14880
14922
  deliveries: z28.array(analyticsDeliveryRowSchema).optional(),
14881
14923
  submissions: z28.array(analyticsSubmissionRowSchema).optional(),
14882
14924
  geo: z28.array(analyticsGeoRowSchema).optional(),
@@ -28894,8 +28936,23 @@ function sessionlessHint(data, origin) {
28894
28936
  "Pages were served but no sessions were counted \u2014 visitors are declining analytics consent, so traffic is measurable and per-visitor behaviour is not. Say so rather than reporting zero visitors."
28895
28937
  ];
28896
28938
  }
28939
+ function measureScopeHint(data) {
28940
+ const scope = data.measureScope?.scope;
28941
+ if (scope === "all") {
28942
+ return [
28943
+ "This company's website tag measures EVERY visitor, not only the ones Baker's campaigns brought. So visits, views and conversions here describe the whole business \u2014 organic, email and direct included. Do not report these as what the campaigns produced; use the per-campaign and per-landing credit for that."
28944
+ ];
28945
+ }
28946
+ if (scope === "outcomes") {
28947
+ return [
28948
+ "This company's website tag reports outcomes only, so no browsing on their own site is measured. Visits and views cover Baker pages alone, and a drop-off between a Baker page and a sale is invisible rather than absent."
28949
+ ];
28950
+ }
28951
+ return [];
28952
+ }
28897
28953
  function buildAnalyticsHints(data, platform, origin) {
28898
28954
  const hints2 = [];
28955
+ hints2.push(...measureScopeHint(data));
28899
28956
  for (const funnel of data.funnels ?? []) {
28900
28957
  const worst = funnel.worstStep;
28901
28958
  if (worst && worst.dropRate !== null && worst.dropRate >= SEVERE_STEP_DROP) {