Repository navigation
Show Plausible engagement metrics, entry and exit pages - #69
Merged
Merged
Conversation
Plausible connections now report bounce rate, visit duration and views per visit site-wide, and bounce rate, time on page and scroll depth for a page. They join Visitors and Page views as chartable tabs with a vs-previous-period badge; a falling bounce rate shows as an improvement and rates compare in percentage points. Engagement is requested in the same query as the traffic totals and trend, so it adds no provider calls. An instance that rejects the newer metrics falls back to the session metrics, then to traffic only. Engagement is left out under a goal filter. Vercel reports none, so its dashboard is unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Chart.js fills each styled line segment separately, which left a hairline gap in the area fill where the dashed final segment begins. The fill now comes from its own unstyled dataset, and the tooltip and hover guide read only the line dataset.
- Pages card gains Entry pages and Exit pages tabs on providers that report visit:entry_page and visit:exit_page (Plausible), loaded on demand. - Expanded breakdown dialogs show bounce rate, time on page and scroll depth for pages, and bounce rate and visit duration for other dimensions. Bars span only the traffic columns, and narrow dialogs drop the extra columns. - Breakdown dialogs use the wider dialog width. - Events and Flags cards no longer scroll sideways in a three-column row, and their headings match the other cards. - Mock connections include entry and exit pages so the demo shows every card.
Clicking a breakdown row, or its label, now toggles that value as a filter, as in Plausible. Opening a page or referrer moves to an icon link that appears on hover, and the active filter's label is highlighted.
- Remember per Plausible instance when engagement metrics were rejected, so later reports skip the failing attempts. The downgrade is only kept once the smaller query succeeds, so an unrelated 400 never sticks. - Plausible CountAsync carries engagement again and GetTotalsAsync delegates to it, as before. - Share the goal-filter and page-scope rules between the Plausible client and the demo mock, so the mock follows page filters and goal filters. - Reset an engagement metric to visitors once a report can't show it, so the selection and URL don't spring back after a filter is removed. - Row clicks ignore the focusable share tooltip and text selections, the message row no longer shows a pointer, and engagement columns get their intended width. - Reuse metricComparison for relative engagement badges.
Each tabbed card now carries its tab list label, how its reports load (eager, selected tab only, or on demand), and whether it collapses to a plain card with one supported option. Selected tabs are passed as one CardSelections object keyed by card id, and tab change events derive from the id, so the grid, report plan and controller no longer special case Pages, Audience and UTM by name. Audience now also collapses to a plain card when a provider reports only devices.
…ages Recaptured from the Demo mock: the overview, the filtered dashboard with page-scoped metrics, the breakdown panels, and the operating-system dialog with its engagement columns.
…upports it The breakdown row click guard only looks at the path inside the row, so the backoffice's focusable scroll container no longer swallows the click. Event property values and flag values filter on row click, and the event list filters by event on Plausible with a details icon beside each event. Vercel keeps opening the details on click.
Event rows behave the same on Plausible and Vercel: a click opens the details, and filtering happens inside them. The details dialog gains a Filter by this event button where the provider supports event filtering.
Cards drop their View all footer. The headline or tabs get a row of their own with an expand icon at the end, and the column headings sit below it. Docs text and screenshots are updated.
The metric tabs sit on the card surface with short dividers instead of a grey band, and the strip is a little shorter. The selected metric keeps its underline.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Daniel Schmidt · project thread
What changed
The summary strip only had Visitors and Page views, which left an empty band to the right. On a Plausible connection it now also shows engagement metrics. Each one is a chartable tab with a badge comparing it to the previous period.
-3 pts). Durations and views per visit use a relative percentage.%or2m 14s), with duration ticks on whole minutes. A period with no data leaves a gap in the line instead of dropping to zero. The fill is drawn as one shape, so there's no seam where the in-progress segment starts.time_on_pageorscroll_depth), the query is retried with the session metrics only, then with traffic only. Engagement never blocks the report. Once a smaller query succeeds, the instance's limit is remembered for an hour, so later reports skip the failing attempts. An unrelated 400 is never remembered.views_per_visitis never requested with a page filter, because Plausible doesn't allow that combination. If the selected engagement tab disappears after a filter change, the selection resets to Visitors instead of springing back later.visit:entry_pageandvisit:exit_page(Plausible). The selected tab loads on demand and is kept in the URL. Without them the card stays a plain Pages card.API
AnalyticsTotals,AnalyticsPointandAnalyticsBreakdownRowgain an optionalEngagement(AnalyticsEngagement) at the end of their parameter lists. This changes their constructors at the binary level, which is acceptable at 0.1.0.AnalyticsDimensiongainsEntryPageandExitPage.PlausibleMetricSupport, taken as an optional constructor parameter byPlausibleAnalyticsClient.types.gen.tsis updated to match.Testing
dotnet test: 243 passing, including Plausible tests for requested metrics, page scope, the goal filter, the 400 fallback chain and its memory, breakdown engagement and entry and exit pages.pnpm test: 276 passing, including row-click filtering inside a focusable container, event rows, the Filter by this event button, value rows and the card expand icons.tscandfallow auditare clean.Docs
The reports guide gains a metrics table, an explanation of the badges, the entry and exit tabs, the dialog columns, row-click filtering and how events and flags drill down. Screenshots are refreshed. The Plausible provider page and the overview mention engagement and the self-hosted fallback.