@wrangled/cli 0.3.156 → 0.3.158

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 (2) hide show
  1. package/dist/main.js +13 -2
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -4179,7 +4179,9 @@ function winnersAdLines(ad, currency, words) {
4179
4179
  const goal = onSales ? words.primary : (words.fallback ?? FIRST_LEAD);
4180
4180
  const [costPer, number] = onSales ? [n.costPerSale, n.sales] : [n.costPerSignup, n.signups];
4181
4181
  const cost = costPer === null ? `no ${goal.many}` : `${money(costPer, currency)} per ${goal.one}`;
4182
- const name = [ad.name ?? `Ad ${ad.adId}`, ad.sku && `[${ad.sku}]`, ad.campaignName && `(${ad.campaignName})`].filter(Boolean).join(" ");
4182
+ const merged = ad.adIds !== undefined && ad.adIds.length > 1 ? ad.adIds.length : 0;
4183
+ const title = merged > 0 ? `${ad.creativeName ?? ad.name} (${merged} ads)` : (ad.name ?? `Ad ${ad.adId}`);
4184
+ const name = [title, ad.sku && `[${ad.sku}]`, ad.campaignName && `(${ad.campaignName})`].filter(Boolean).join(" ");
4183
4185
  const tags = Object.entries(ad.tags).map(([field, value]) => `${field}: ${value}`).join(", ");
4184
4186
  const count = number !== null && countOf(number, goal);
4185
4187
  const facebook = n.facebookResults == null ? "" : `, Facebook counts ${tenths(n.facebookResults)}`;
@@ -4534,7 +4536,16 @@ function printPageResults(results) {
4534
4536
  console.log(renderTable(["page", "ad", "ad name", "currency", ...numbers], results.adPages.map((r) => ({ ...pageNumbers(r), ad: r.adId ?? "(no Meta ad)", "ad name": r.adName === null ? "" : excerpt(r.adName, 30) }))));
4535
4537
  console.log('\n"by ad link" counts sales whose buyer\'s landing page was not recorded, credited to the page the ad links to now.');
4536
4538
  console.log('"by last visit" counts sales whose buyer\'s first landing page was not recorded and whose ad links to no single page, credited to the page of their last visit.');
4537
- console.log('"(no page named)" holds payments recorded by hand in GoHighLevel, and buyers with no recorded page.');
4539
+ const unnamed = results.pages.filter((r) => r.pageKey === null);
4540
+ const reasons = unnamed.flatMap((r) => (r.noPage ?? []).map((reason) => ({ ...reason, currency: r.currency })));
4541
+ if (reasons.length === 0) {
4542
+ if (unnamed.some((r) => (r.sales ?? 0) > 0))
4543
+ console.log('"(no page named)" holds payments recorded by hand in GoHighLevel, and buyers with no recorded page.');
4544
+ return;
4545
+ }
4546
+ console.log('\nWhy the sales in "(no page named)" have no page:');
4547
+ for (const r of reasons)
4548
+ console.log(`(no page named), ${r.currency}: ${r.sales} ${r.sales === 1 ? "sale" : "sales"}, ${r.revenue} revenue: ${r.credit}, ${r.means}`);
4538
4549
  }
4539
4550
  const MESSAGE_NUMBERS = ["currency", "helped", "helped revenue", "last nudge", "last nudge revenue", "first from Facebook"];
4540
4551
  const BOOKED_CALL_NUMBERS = ["booked calls helped", "booked calls last nudge"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrangled/cli",
3
- "version": "0.3.156",
3
+ "version": "0.3.158",
4
4
  "description": "Command-line access to your marketing data warehouse, for people and coding agents",
5
5
  "type": "module",
6
6
  "bin": {