@liiift-studio/sanity-visitor-insights 0.54.0 → 0.56.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/index.js +22 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/studio/VisitorInsightsTool.tsx +11 -6
- package/src/studio/panels.test.tsx +74 -0
- package/src/studio/panels.tsx +47 -16
package/dist/index.js
CHANGED
|
@@ -1936,7 +1936,7 @@ function OverviewPanel({ data, previous, onBrush }) {
|
|
|
1936
1936
|
average.status === "partial" && average.note && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: average.note })
|
|
1937
1937
|
] });
|
|
1938
1938
|
})(),
|
|
1939
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: "From your
|
|
1939
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: "From your orders, so exact." })
|
|
1940
1940
|
] }) }),
|
|
1941
1941
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Card, { padding: 3, radius: 2, tone: "transparent", border: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_sanity_ui_compat3.Stack, { space: 3, children: [
|
|
1942
1942
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Label, { size: 1, muted: true, children: "Visitors per order" }),
|
|
@@ -2044,7 +2044,6 @@ function OverviewPanel({ data, previous, onBrush }) {
|
|
|
2044
2044
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2045
2045
|
ChartData,
|
|
2046
2046
|
{
|
|
2047
|
-
note: "A negative miss means GA4 counted more than Vercel that day \u2014 usually a tag firing twice, not extra traffic.",
|
|
2048
2047
|
label: "Show these figures as a table",
|
|
2049
2048
|
rows: data.crossSource ?? [],
|
|
2050
2049
|
rowKey: (d) => d.date,
|
|
@@ -2388,7 +2387,11 @@ function AcquisitionPanel({ data, previous }) {
|
|
|
2388
2387
|
filterOn: (row) => `${row.source} ${row.channel} ${row.medium ?? ""} ${row.campaign ?? ""}`,
|
|
2389
2388
|
filterPlaceholder: "Filter sources",
|
|
2390
2389
|
exportName: "traffic-sources",
|
|
2391
|
-
truncatedNote:
|
|
2390
|
+
truncatedNote: shortListNote(
|
|
2391
|
+
Boolean(data.rowsTruncated),
|
|
2392
|
+
Boolean(data.rowsWithheld),
|
|
2393
|
+
"For a foundry the tail of small design blogs is often the referral story."
|
|
2394
|
+
),
|
|
2392
2395
|
columns: [
|
|
2393
2396
|
{
|
|
2394
2397
|
key: "source",
|
|
@@ -2504,8 +2507,7 @@ function AcquisitionPanel({ data, previous }) {
|
|
|
2504
2507
|
" of those sales; the rest came from sources outside this list, so this column does not add up to the whole."
|
|
2505
2508
|
] })
|
|
2506
2509
|
] })
|
|
2507
|
-
] })
|
|
2508
|
-
data.rowsWithheld && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(NoticeList, { notices: ["GA4 withheld some low-traffic rows for privacy, so this list is shorter than reality."] })
|
|
2510
|
+
] })
|
|
2509
2511
|
] });
|
|
2510
2512
|
}
|
|
2511
2513
|
function firstStepRate(steps) {
|
|
@@ -2530,6 +2532,11 @@ function spread(segments) {
|
|
|
2530
2532
|
if (ratio < RATIO) return null;
|
|
2531
2533
|
return `${worst.label} reaches the second step at ${formatPercent(worst.rate, 2)} against ${best.label}'s ${formatPercent(best.rate, 2)} \u2014 about ${Math.round(ratio)} times worse, on ${formatCount(worst.users)} visitors. The combined funnel above averages the two and describes neither.`;
|
|
2532
2534
|
}
|
|
2535
|
+
function shortListNote(truncated, withheld, tail) {
|
|
2536
|
+
if (!truncated && !withheld) return void 0;
|
|
2537
|
+
const cause = truncated && withheld ? "GA4 returned only its top rows, and withheld others with too few people to report" : truncated ? "GA4 returned only its top rows" : "GA4 withheld rows with too few people to report";
|
|
2538
|
+
return `${cause}, so this list is shorter than reality. ${tail}`;
|
|
2539
|
+
}
|
|
2533
2540
|
function JourneyPanel({ data }) {
|
|
2534
2541
|
const [segmentKey, setSegmentKey] = import_react4.default.useState(null);
|
|
2535
2542
|
const segments = data.segments ?? [];
|
|
@@ -2727,7 +2734,11 @@ function TypefaceInterestPanel({ data }) {
|
|
|
2727
2734
|
filterOn: (row) => row.typeface,
|
|
2728
2735
|
filterPlaceholder: "Filter typefaces",
|
|
2729
2736
|
exportName: "typeface-interest",
|
|
2730
|
-
truncatedNote:
|
|
2737
|
+
truncatedNote: shortListNote(
|
|
2738
|
+
Boolean(data.rowsTruncated),
|
|
2739
|
+
Boolean(data.rowsWithheld),
|
|
2740
|
+
"A family missing from this table has not necessarily gone quiet \u2014 and for a foundry the long tail is most of the catalogue."
|
|
2741
|
+
),
|
|
2731
2742
|
columns: [
|
|
2732
2743
|
{
|
|
2733
2744
|
key: "typeface",
|
|
@@ -2845,7 +2856,7 @@ function TypefaceInterestPanel({ data }) {
|
|
|
2845
2856
|
] }),
|
|
2846
2857
|
(data.licences?.length ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_sanity_ui_compat3.Stack, { space: 3, children: [
|
|
2847
2858
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SectionTitle, { title: "How licences sell" }),
|
|
2848
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 1, muted: true, children: "From
|
|
2859
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 1, muted: true, children: "From your orders, so exact. Tier and term are separate rows, because they are the two variables in the pricing question and a tier that sells well at one year may not at perpetual." }),
|
|
2849
2860
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2850
2861
|
ProportionChart,
|
|
2851
2862
|
{
|
|
@@ -2862,7 +2873,6 @@ function TypefaceInterestPanel({ data }) {
|
|
|
2862
2873
|
}
|
|
2863
2874
|
)
|
|
2864
2875
|
] }),
|
|
2865
|
-
data.rowsWithheld && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(NoticeList, { notices: ["GA4 withheld some low-count rows for privacy. A family missing from this table has not necessarily gone quiet."] }),
|
|
2866
2876
|
data.revenueIsApportioned && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: "Revenue is apportioned: an order covering several families or licences is split evenly between them, because the order documents carry no per-line value." })
|
|
2867
2877
|
] });
|
|
2868
2878
|
}
|
|
@@ -3173,14 +3183,11 @@ function CoverageRibbon({ ratio }) {
|
|
|
3173
3183
|
const seen = Math.round((1 - ratio) * 100);
|
|
3174
3184
|
const multiplier = seen > 0 ? Math.round(100 / seen) : null;
|
|
3175
3185
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sanity_ui_compat4.Card, { padding: 3, radius: 2, tone: ratio > 0.6 ? "critical" : "caution", border: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_sanity_ui_compat4.Text, { size: 1, children: [
|
|
3176
|
-
"
|
|
3186
|
+
"Google Analytics is seeing about ",
|
|
3177
3187
|
seen,
|
|
3178
|
-
"% of
|
|
3179
|
-
" "
|
|
3180
|
-
|
|
3181
|
-
" these",
|
|
3182
|
-
multiplier !== null && multiplier > 1 ? ` (very roughly ${multiplier}\xD7)` : "",
|
|
3183
|
-
". Figures drawn from your orders \u2014 anything labelled as coming from Sanity \u2014 are exact and must not be scaled up. Data health explains the rest, and how uncertain it is."
|
|
3188
|
+
"% of your traffic here, so treat the figures below as roughly ",
|
|
3189
|
+
multiplier === null ? "many times" : `${multiplier}\xD7`,
|
|
3190
|
+
" low. Anything marked (orders) is exact \u2014 do not scale it."
|
|
3184
3191
|
] }) });
|
|
3185
3192
|
}
|
|
3186
3193
|
function ReadyReport({
|