@wrangled/cli 0.3.159 → 0.3.161
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/guide.js +1 -1
- package/dist/main.js +8 -5
- package/dist/report-columns.js +1 -0
- package/package.json +1 -1
package/dist/guide.js
CHANGED
|
@@ -154,7 +154,7 @@ For a worked start, run \`${cli} examples\`. It prints plain questions, such as
|
|
|
154
154
|
For "how is the funnel doing?", "which campaigns are working?" and "where does the money come from and go?", start with these three reports before writing SQL. All three cover the last 30 days ending today in the workspace reporting time zone unless \`--from\` and \`--to\` (YYYY-MM-DD, both days included) say otherwise, and at most 400 days.
|
|
155
155
|
|
|
156
156
|
- \`${cli} funnel [--grain day|week|month]\` prints ad spend, leads, booked calls, calls held, sales and net revenue per day, week (starting Monday) or month, with cost per lead, per booked call and per sale and ROAS, then totals for the whole range.
|
|
157
|
-
- \`${cli} campaigns [--channel <channel>] [--limit <n>]\` prints each campaign's spend, leads, booked calls, sales and revenue, best first
|
|
157
|
+
- \`${cli} campaigns [--channel <channel>] [--limit <n>]\` prints each campaign's spend, leads, booked calls, cost per booked call, sales and revenue, best first, then totals over every matching campaign. Best first means most first-touch revenue, then most spend (most Triple Whale revenue when it stands in for sales). When \`${cli} winners\` judges the client's ads on booked calls, or no sales are connected at all, it means the cheapest booked call first among campaigns that spent, then the most calls; the JSON's \`ranked_by\` names the figure. Each lead and sale is credited to the person's first touch and last touch side by side. \`--limit\` is 1 to 200 (default 50); \`--channel\` is meta, google, affiliate, a utm_source, unknown or recorded_in_crm.
|
|
158
158
|
- \`${cli} calls unattributed [--attribution first_touch|last_touch] [--limit <n>]\` answers "why do these booked calls have no ad?": it counts the booked calls in the range (by day booked), how many were credited to a Facebook ad and how many were not, as \`ad_results_daily\` credits them (to the first touch by default), splits the calls with no ad by why (\`no_person\`: the booking's contact has no email or phone to match a person; \`meta_without_ad\`: a Facebook visit whose link named no single ad; \`not_meta\`: another channel; \`visit_after_call\`: the visits are dated after the booking; \`other_touch_only\`: only a visit of the other kind, such as a latest visit and no first one when crediting the first touch; \`no_visit\`: no tagged visit at all), then lists those calls newest first with the booking's contact id, the person id and the touch's channel, campaign, ad and landing page. With and without add up to every booked call. \`--limit\` is 1 to 1000 (default 200); the counts always cover every call. The rows are in the \`booked_call_credits\` view; join \`touches\` on \`person_id\` to see each visit's tags.
|
|
159
159
|
- \`${cli} calls compare [--event <event>]\` answers "do Meta's call numbers match the booked calls?": per Facebook ad over the range, the calls Meta reports (its results, the workspace's chosen result type as Ads Manager shows it, or with \`--event\` that one Meta action type, such as schedule_website), the booked calls \`ad_results_daily\` credits to the ad on the first touch and on the last touch, and each delta, booked minus Meta (negative when Meta reports more). An ad missing from one source counts 0 there. Most Meta calls first, then a total row; \`--format json\` gives the same numbers.
|
|
160
160
|
- \`${cli} money [--grain day|week|month]\` prints money in (gross, refunds, net, orders), ad spend, affiliate payouts, what is left after ad costs and ROAS per period, then totals for the whole range, money in per payment source (stripe, ghl) and the biggest refund days. Refunds come off on the day they were made, not the day of the sale. \`left_after_ad_costs\` is net less ad spend and affiliate payouts; it is not profit. Its \`roas\` is net over ad spend alone, so it differs from \`${cli} funnel\`'s, which divides by all spend including affiliate payouts.
|
package/dist/main.js
CHANGED
|
@@ -574,7 +574,9 @@ const commands = {
|
|
|
574
574
|
const { campaignResults } = await api(await resolveConnection(options), `/api/v1/reports/campaigns${query}`);
|
|
575
575
|
if (options.format === "json")
|
|
576
576
|
return printJson({ campaignResults });
|
|
577
|
-
const
|
|
577
|
+
const byCalls = campaignResults.ranked_by === "cost_per_booked_call_first_touch" && campaignResults.rows.some((row) => Number(row.booked_calls_first_touch) > 0);
|
|
578
|
+
const order = byCalls ? "cheapest booked call first" : "best first";
|
|
579
|
+
const title = campaignResults.channel === null ? `Campaigns, ${order}` : `${campaignResults.channel} campaigns, ${order}`;
|
|
578
580
|
printReport(title, campaignResults, ["channel", "campaign_id", "campaign_name", "currency"], campaignLayout(campaignResults));
|
|
579
581
|
printLeftOut(campaignResults.left_out, "the totals (the rows keep it)");
|
|
580
582
|
},
|
|
@@ -1681,10 +1683,10 @@ const commands = {
|
|
|
1681
1683
|
},
|
|
1682
1684
|
},
|
|
1683
1685
|
winners: {
|
|
1684
|
-
usage: "winners [--week <YYYY-MM-DD> | --days <n> | --from <YYYY-MM-DD> --to <YYYY-MM-DD>] [--top <n>] [--ad-format image|video|carousel] [--offer <offer key>] (which Facebook ads and landing pages won and flopped, judged on each client's goal; see winners goals)",
|
|
1686
|
+
usage: "winners [--week <YYYY-MM-DD> | --days <n> | --from <YYYY-MM-DD> --to <YYYY-MM-DD>] [--top <n>] [--ad-format image|video|carousel] [--offer <offer key or name>] (which Facebook ads and landing pages won and flopped, judged on each client's goal; see winners goals)",
|
|
1685
1687
|
async run(args, options) {
|
|
1686
1688
|
if (args.length > 0)
|
|
1687
|
-
throw new CliError("Usage: winners [--week <date> | --days <n> | --from <date> --to <date>] [--top <n>] [--ad-format image|video|carousel] [--offer <offer key>]", exitCodes.usage);
|
|
1689
|
+
throw new CliError("Usage: winners [--week <date> | --days <n> | --from <date> --to <date>] [--top <n>] [--ad-format image|video|carousel] [--offer <offer key or name>]", exitCodes.usage);
|
|
1688
1690
|
const query = new URLSearchParams();
|
|
1689
1691
|
for (const [name, value] of Object.entries({ ...winnersPeriod(options), top: options.top, format: options.entryTags.format, offer: options.offer }))
|
|
1690
1692
|
if (value !== undefined)
|
|
@@ -5234,8 +5236,9 @@ Options:
|
|
|
5234
5236
|
your own ads tagged the same way with their results; with knowledge tag, the tags to put on an entry;
|
|
5235
5237
|
with winners, --ad-format ranks only ads whose format tag is that one (run ads tag-formats first);
|
|
5236
5238
|
with meta ad create, the new ad's angle, hook kind and format, which its name is written from
|
|
5237
|
-
--offer <key> with winners, rank ads on first-touch sales of this offer in the funnel map only
|
|
5238
|
-
still count every sale); with profile messaging, that offer's outcome map,
|
|
5239
|
+
--offer <key> with winners, rank ads on first-touch sales of this offer in the funnel map only, by its key or
|
|
5240
|
+
name (landing pages still count every sale); with profile messaging, that offer's outcome map,
|
|
5241
|
+
segments and personas
|
|
5239
5242
|
--concept <key> meta ad create: the new ad's concept, a key on the client's concept list
|
|
5240
5243
|
--style <style> meta ad create: the new ad's style, if it has one
|
|
5241
5244
|
--confidence high|medium|low with knowledge tag, how sure you are of the tags
|
package/dist/report-columns.js
CHANGED