@koda-sl/baker-cli 0.241.0 → 0.242.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
@@ -12529,6 +12529,20 @@ var analyticsCampaignRowSchema = z24.object({
12529
12529
  utmSource: z24.string(),
12530
12530
  utmMedium: z24.string(),
12531
12531
  utmCampaign: z24.string(),
12532
+ /**
12533
+ * The platform a click id proves, or `""` when the visit carried none.
12534
+ *
12535
+ * What separates a campaign the ad breakdown already reports — with its
12536
+ * platform proven and its ad set and ad underneath — from one nothing else
12537
+ * can show: the newsletter, the partner link, the hand-tagged post. The two
12538
+ * are otherwise identical, because `utm_campaign={campaignid}` is the normal
12539
+ * tagging convention and produces the same ids in both places.
12540
+ *
12541
+ * Kept on the row rather than filtered out here: a CLI hint reads an empty
12542
+ * campaign list as "no campaign tagging on any traffic", and dropping the
12543
+ * paid ones would make that fire on a perfectly tagged account.
12544
+ */
12545
+ clickPlatform: z24.string(),
12532
12546
  sessions: z24.number().int().nonnegative(),
12533
12547
  conversions: z24.number().int().nonnegative(),
12534
12548
  conversionRate: z24.number().min(0).max(1).nullable()
@@ -13241,7 +13255,8 @@ var analyticsTrackingPlatformSchema = z24.object({
13241
13255
  /** The pairs to append to the account's tagging, or `""`. */
13242
13256
  suffix: z24.string(),
13243
13257
  whereItGoes: z24.string(),
13244
- fix: z24.string().optional()
13258
+ /** Which level to put them at, who can write it, and how an existing value is treated. */
13259
+ fix: z24.string()
13245
13260
  });
13246
13261
  var analyticsTrackingResponseSchema = z24.object({
13247
13262
  ok: z24.literal(true),
@@ -23296,8 +23311,18 @@ function buildAnalyticsHints(data, platform) {
23296
23311
  "No campaign tagging on any traffic \u2014 ad clicks cannot be attributed to a campaign until the destination URLs carry utm parameters."
23297
23312
  );
23298
23313
  }
23314
+ hints.push(...campaignOriginHints(data.topCampaigns));
23299
23315
  return hints;
23300
23316
  }
23317
+ function campaignOriginHints(rows) {
23318
+ const campaigns = rows ?? [];
23319
+ const fromAds = campaigns.filter((row) => row.clickPlatform !== "");
23320
+ if (fromAds.length === 0) return [];
23321
+ const own = campaigns.length - fromAds.length;
23322
+ return [
23323
+ `${fromAds.length} of these campaigns arrived on an ad click (\`clickPlatform\` is set). \`baker analytics ads --role campaign_id\` MAY report the same campaigns under the platform's own ids \u2014 check before you quote both, or you will count one campaign twice. It may equally report nothing: \`ads\` only reads parameters the account tags separately, and \`utm_campaign\` is reserved and never reaches it, so an account whose only campaign signal is \`utm_campaign\` has its campaigns HERE and nowhere else. Never report "no campaigns" on the strength of an empty \`ads\`. ${own === 0 ? "Every row here came from an ad." : `The other ${own} carry no click id at all \u2014 a newsletter, a partner link, a tagged post \u2014 and only this report can show them.`}`
23324
+ ];
23325
+ }
23301
23326
 
23302
23327
  // src/commands/analytics/presets.ts
23303
23328
  var ANALYTICS_PRESET_INFO = [
@@ -24019,7 +24044,7 @@ var trackingCommand = (() => {
24019
24044
  Read this before auditing an ad account and before answering any "which ad performed best" question. Each dimension comes back in one of four states, and they need different things:
24020
24045
  covered \u2014 arriving and understood, nothing to do
24021
24046
  unmapped \u2014 the URLs carry it under a name Baker does not read yet. Free to fix, and it repairs the traffic already collected: run the \`mapCommand\` in the response
24022
- missing \u2014 nothing carries it. Add \`suffix\` to the account's tagging (\`whereItGoes\` says where, \`fix\` says whether Baker can stage it). This one cannot be filled in later \u2014 a parameter's values are only stored once it starts arriving
24047
+ missing \u2014 nothing carries it. \`fix\` says which LEVELS that platform accepts tagging at (widest first \u2014 prefer it), which Baker can stage and which the user must do by hand, and how each field treats what is already in it. \`suffix\` is only the MISSING pairs, so read the current value, add them, write the union. This one cannot be filled in later \u2014 a parameter's values are only stored once it starts arriving
24023
24048
  unknown \u2014 no visit arrived AND the account could not be read. Not a finding; do not report it as untagged
24024
24049
 
24025
24050
  Baker reads the client's own Google tracking templates and Meta URL parameters, so a platform that has not run yet still gets a real answer.