Commit Graph

405 Commits

Author SHA1 Message Date
Sanne de Vries dfeda94e06
Add report percentages to dashboard and details view (#5923)
* Update report percentages on dashboard and details view

* Add percentages to Countries, Regions, and Cities reports

* Add percentages to Channels, Sources, and UTM reports

* Add percentages to top pages, entry pages, and exit pages reports

* Update tests to include percentages

* Change dashboard copy from title case to sentence case

* Update details modal style

* Make animations snappier

* Introduce max height to modal and make inner content scrollable

* Improve modal mobile design

- Enable horizontal scroll for details modal on mobile
- Add responsive spacing and positioning to modal

* Added mobile tap behavior to external link in list report

* Show tooltips only when in comparison mode or when the number is abbreviated

* remove previously added showTooltip prop

- This isn't needed anymore since we now handle the tooltip logic in the MetricValue component

* Show long format upon hovering detailed view metrics

* Added mobile tapping behaviour to detailed view

* Added percentages to all detailed views

* Add mobile swipe-to-close behavior for modal

* Adjust sensitivity of modal drag to close

* Use hammerjs for swipe-to-close modal behaviour

* Prevent dragging if gesture starts inside table

* Show 2 decimal places for percentages < 0.1% across dashboard

* Adjust dark mode styles

* Add hover effect to external link icon

* Update tests to expect two-decimal percentages

* Undo hammer install and revert to old modal styling

* Remove CR and % columns from goals and custom props reports on dashboard, and show on hover in detailed view

* Remove unused constants

* Undo conversion rate on hover behaviour

- Unlike percentages, CR should show permanently.

* Show percentages permanently in custom props detailed view

* Adjust width of conversion metrics column

* Updated metric-value test

* Update top-bar test

* Added changelog entry

* Fix test expectations for percentages with imported data

- Update tests to expect correct percentages (≤100%) when imported data is included. These tests will fail until the percentage calculation bug is fixed, documenting the expected behavior.

* Add imported_visitors to tests to ensure correct total_visitors calculation

* Correct imported_visitors count in test
2025-12-16 12:43:16 +00:00
Artur Pata f07dc8dd49
Display segment filters to anyone that can see the dashboard being filtered by the segment (#5935)
* Remove segment filters secrecy

* Update changelog

* Update CHANGELOG.md

Co-authored-by: Adam Rutkowski <hq@mtod.org>

---------

Co-authored-by: Adam Rutkowski <hq@mtod.org>
2025-12-15 10:21:29 +00:00
Artur Pata e4b282a610
Fix broken v1 filters redirect (#5941) 2025-12-11 11:51:38 +00:00
Artur Pata c4ea07d8bc
Fix /change-domain page permissions (#5939)
* Add test case

* Fix change domain permissions

* Update changelog

* Add more comprehensive tests for other roles
2025-12-10 09:44:23 +00:00
Artur Pata 007155ba60
Validate password cookie for password-protected shared links on internal stats API requests (#5932)
* Works

* Move shared link password check to AuthorizeSiteAccess plug

* Write changelog, cleanup

* Handle cookies already fetched in AuthorizeSiteAccess

* Unify shared link kind with plugins API entity
2025-12-08 07:05:31 +00:00
Artur Pata b624f39d17
Release 3.1.0 (#5883) 2025-11-13 07:02:48 +00:00
Artur Pata af7dd46458
Fix shared link hostname (#5870)
* Fix missing share link hostname

* Update changelog

* Tests
2025-11-05 06:43:15 +00:00
Artur Pata 2ca24e77cc
Make sure imported data switch appears on Safari (#5872) 2025-11-05 06:31:59 +00:00
Adrian Gruntkowski a07aaa67eb
Add ability to enforce 2FA for all members of the team (#5855)
* Introduce `force_2fa` team policy and add API for toggling it

* Implement 2FA enforcement

* Make team policy available to CE too

* Improve copy (h/t @metmarkosaric)

* Send email to all team members when enforcing 2FA is enabled

* Only owners can enable and disable enforcing 2FA

* Don't send email to the user who enabled enforcing 2FA

* Add team selection screen to 2FA enforce exceptions

* Fix email URL

* Add tests

* Hide the Force 2FA section for non-owners completely

* Improve e-mail formatting

* Point at 2FA docs page for now

* Add changelog entry

* Reverse the exception to make dialyzer happy

* Fix a typo

Co-authored-by: Uku Taht <Uku.taht@gmail.com>

* Fix typespec 🤡 (h/t @ukutaht)

* Deliver force 2FA email notifications asynchronously

* Fix a typo in AlpineJS variable name (h/t @ukutaht)

* Put parameter in path helper instead of concatenating it as a string

* Improve and test audit logging of toggling 2FA enforcement

* Introduce 3 second delay before redirect

* Test audit logging only on EE

---------

Co-authored-by: Uku Taht <Uku.taht@gmail.com>
2025-11-04 16:33:44 +00:00
Artur Pata 64aa2434e9
Update CE-facing changelog about script v2 related changes (#5845) 2025-11-03 10:22:34 +00:00
Artur Pata 457c483416
Omit Subscription and Invoices menu on CE (#5856)
* Update mua

* Fix issue with unexpected menu items

* Update changelog
2025-11-03 09:23:10 +00:00
Sanne de Vries 90404c4ec3
Fix dark mode improvements oversights (#5839)
- Added dark mode change to CHANGELOG.md
- Fixed broken `WithImportedSwitch` icon focus outline
- Updated comments in `app.css` referencing old color scheme
2025-10-28 10:21:10 +00:00
Adrian Gruntkowski 49cff303f4
Show bounce rate in Detail view of Top Entry Pages (#5747)
* Show bounce rate in Detail view of Top Entry Pages

* Update tests and test fixtures

* Update CHANGELOG.md
2025-09-23 11:38:20 +00:00
Adam Rutkowski 810e48da2c
Add top goal conversions to weekly/monthly e-mail digest (#5711)
* Add top goal conversions to weekly/monthly e-mail digest

* Fix typo
2025-09-23 06:39:14 +00:00
Karl-Aksel Puulmann 1531386b76
FULL join for time:hour as well as time:minute (#5715)
* FULL join for time:hour as well as time:minute

Follow-up to https://github.com/plausible/analytics/pull/5694/files#r2321567271

A session might be active over multiple hours, but not (currently)
reported as such when requesting only specific metrics per hour.
This fixes that problem.

* Handle full join logic correctly

---------

Co-authored-by: Uku Taht <Uku.taht@gmail.com>
2025-09-15 14:14:59 +00:00
Karl-Aksel Puulmann db448d7404
Stats: Rebuild session smearing for timeseries (#5694)
* Refactor table_decider#partition_metrics

* Refactor query pipeline to return a list of subqueries after splitting

* Move order_by out of join logic

* Refactor joining logic in query_builder

1. JOIN type is now set in QueryOptimizer
2. JOIN logic is now table and list-size agnostic

* Comment an edge case

* Rebuild session/visit smearing

Previously, whenever graphing any visit metric hourly/realtime, visit_duration and other
visit metrics would be way higher than expected, due to long sessions
dragging each bucket up and up. Now visits/visitors metrics are still
smeared and other visit metrics are counted under last bucket user was
active in.

visits metric was also overcounted (see new tests).

* Remove unneeded case

* Unit test for smearing in tabledecider
2025-09-08 06:21:12 +00:00
Karl-Aksel Puulmann 9af40a278d
Trim month, year, day periods to local now on main graph (#5698)
* Revert "Revert "Trim `month`, `year`, `day` periods to local now on main graph (#5668)" (#5684)"

This reverts commit 2d11681f25.

* Does not trim for comparisons

* Include the current hour in the trimmed time range
2025-09-04 09:13:17 +00:00
Adam Rutkowski 67674b984b
Replace Search Console property select with ComboBox (#5689) 2025-09-01 13:07:07 +00:00
Adrian Gruntkowski 2d11681f25
Revert "Trim `month`, `year`, `day` periods to local now on main graph (#5668)" (#5684)
This reverts commit 563c3d22ba.
2025-08-28 14:58:57 +00:00
Adrian Gruntkowski 70c9a55bf8
Add custom props to full export (#5666)
* Add custom props to full export

* Pass full `site` struct to `export_queries`

* Export only internal props if plan lacks custom props

* Add changelog entry

* Add spot check test for custom props

* Do not generate cartesian product of prop/value pairs 🤦
2025-08-28 13:13:01 +00:00
Adam Rutkowski 563c3d22ba
Trim `month`, `year`, `day` periods to local now on main graph (#5668)
* Trim `month`, `year`, `day` periods to now on main graph

* Revert "Trim `month`, `year`, `day` periods to now on main graph"

This reverts commit 4f3930111d3a2737a51686e067d9b64f0d85ad58.

* Re-implement trimming in query optimizer instead

* Update JS types

* This is getting confusing

* Trim in stats_controller

* Set `query.now` based on query_praser and date results

* query.period -> query.input_date_range

* Changelog

* Test for response query.date_range

---------

Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
2025-08-28 09:51:56 +00:00
Adam Rutkowski e3bef74cde
Preserve query params for authenticated shared links (#5640) 2025-08-18 13:44:34 +00:00
Artur Pata 3bdbe83383
Script v2: Sync event.props.path for special path-based events from event.pathname (#5559)
* Sync pathname to event.props.path for special path-based goals

* Stop adding event.props.path for 'Form: Submission' events

* Update tracker script version

* Fix test expectations

* Fix format

* Simplify maybe_put_props_path with 'with'

* Add specs, fix factory

* Update tracker changelog

* Update EE/CE changelog

* Remove business logic from factory

* Refactor event.props.path sync result to be validated with the rest of the custom props

* Clarify doctests and update function name
2025-07-14 08:39:25 +00:00
Adrian Gruntkowski 359438a899
Implement ability to leave team (#5555)
* Implement ability to leave team

* Add changelog entry

* Fix button copy

* Alter "Delete my account" button label to "Delete My Account"
2025-07-09 12:41:59 +00:00
Karl-Aksel Puulmann d215e50982
ScriptV2: Rework WordPress plugin token adding flow (#5493)
* Remove dead code

* Rework plugin API token flow

* Changelog

* Redundant code

* Remove onfocus
2025-06-12 08:18:58 +00:00
Artur Pata 429b055920
Update headlessui to v1.7.19, refactor site switcher (#5255)
* Migrate some

* Making progress

* All fixed

* Convert interval picker to tsx

* Fix format

* Fix tests

* Make sure focus outline looks right on DropdownTabButton

* Refactor Site Switcher to Popover

* Fix site switcher test

* Better jsdom mocks in assets tests

* Try svg placeholder favicon

* Update favicon test

* Try giving transition config directly

* Remove empty props

* Remove unnecessary closeDropdown to prevent Firefox transition issue

* Register open dropmenus globally

This is needed to prevent invalid state when navigating with site hotkeys with Firefox while a dropdown is open and coming back using browser

* Colocate popover-specific component

* Clarify behaviour on hitting hotkey for current site

* Try fix Firefox issue

* Try 1.7.19

* Commit to @headlessui/react v1.7.x

* Fix last two transition origins

* Align active tab on baseline

* Remove unneeded global dropmenu state

* Add changelog

* Funnels menu is searchable and scrollable

* Fix transform origin

* Stop funnels menu from holding onto search state

* Mandate ref be passed to SearchInput from the outside
2025-05-07 05:22:53 +00:00
Karl-Aksel Puulmann a3db3af806
Avoid compiling pageleave variant and p.js (#5351)
* Avoid compiling pageleave variant

Instead, it's treated as a no-op. Tracker still serves it.

Compile wall time went down from 86s -> 46s.

* Vendor, no longer compile p.js

This was a legacy script variant which we keep for backwards
compatibility but little else.

* chore: Bump tracker_script_version to 6
2025-04-29 06:42:48 +00:00
Karl-Aksel Puulmann 2114c6232d
Allow marking custom events as non-interactive (#5295)
* Tracker: Allow sending non-interactive custom events

These will not affect is_bounce

* Allow marking events as `non-interactive` in events API, change bounce definition

Ref: https://3.basecamp.com/5308029/buckets/26383192/card_tables/cards/8450017341
Feedback: https://feedback.plausible.io/220

* CHANGELOG.md

* credo

* Update tracker script version

* Explicitly ignore event.interactive in schema

* Replace an old test util
2025-04-21 08:11:58 +00:00
Barry Pollard 34bc464fb2
Only log a pageview for visible pages (#5344)
* Only log a pageview for visible pages

* Add changelog

* Update tracker/src/plausible.js

Co-authored-by: Artur Pata <artur.pata@gmail.com>

* Update tracker/src/plausible.js

* Bump manually

---------

Co-authored-by: Artur Pata <artur.pata@gmail.com>
Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>
Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
2025-04-17 14:05:46 +03:00
Artur Pata 05bd71a609
Make clicking Compare / Disable Comparison in period picker menu close the menu (#5333) 2025-04-16 11:39:59 +00:00
hq1 96ebd01f00
Release 3.0.0 (#5309)
* Update User schema with a field required by teams migration

* Start cloak vault for self-hosted release migrations.

Since this one is using schemas, existing encrypted columns
do require cloak to be up.

* Update changelog

* Make trial notification ee-only

* Replace `Plausible.ee?/0` with `ee?/0` across the codebase

* Bump release date
2025-04-11 08:07:57 +00:00
Artur Pata 2a18ba8f40
Hide footer when viewing stats (#5254)
* Stop showing footer with stats, except when user is not logged in / viewing shared dashboard

* Add testsfor Site Settings menu CE and EE

* Fix test titles, test org and tags
2025-04-11 05:06:27 +00:00
RobertJoonas 087b6e77bc
last 90 days -> last 91 days (#5301) 2025-04-09 16:40:06 +00:00
RobertJoonas 27290b9899
Change default period to today for brand new sites (#5298)
* default period to today for brand new sites

* use uppercase
2025-04-09 10:48:42 +00:00
Karl-Aksel Puulmann 3d1d0c5139
APIv2: More tolerant shorthands for date ranges (#5282)
* APIv2: More tolerant shorthands for date ranges

I was using APIv2 today and got pissed off that I couldn't do
`"date_range": "3d"`. So I went ahead and fixed this issue...

* Changelog

* typegen

* fix

* More invalid tests
2025-04-09 10:38:54 +00:00
RobertJoonas 4eb4b68b99
Sort by exit rate (#5289)
* WIP

* Works, maybe

* More tests

* format + slight refactor special_metrics

* implement exit_rate equivalent to current dashboard metric

* add validations to query_parser

* implement comparisons for exit_rate

* merge imported exit rate

* plug in the new metric

* make exit_rate sortable

* changelog

* generate types

* rename tests

* changelog

* maintain order of special metrics

* move exit_rate to the bottom as the less significant special metric

* capitalize null + query assign tweaks

* add comment

* Update lib/plausible/stats/sql/special_metrics.ex

Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>

---------

Co-authored-by: Artur Pata <artur.pata@gmail.com>
Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>
2025-04-09 09:47:12 +00:00
Adrian Gruntkowski 1e17d54b5b
Set site and member limits to unlimited for CE (#5288)
* Set site and member limits to unlimited for CE

* Don't even compile billing tests that trigger warnings in `ce_test`

* Split layout test into 2 distinct tests for CE and EE due to limits

* Update CHANGELOG.md

* Remove redundant test tag
2025-04-08 14:22:20 +00:00
Karl-Aksel Puulmann 6127ebccc1
time-on-page: Remove flag, CHANGELOG.md, time_on_page in APIv2, update old tests (#5277)
* Remove new_time_on_page feature flag

* Update tests to use new time on page

* Mark time-on-page as a public metric in APIv2

* CHANGELOG.md

* Validate time_on_page in APIv2

* Update typing

* Remove redudant arguments

* Update GA4 test

* Update stats_controller_test

* Remove assertion from csv_importer

* Add nil case to new time on page tests
2025-04-08 07:28:03 +00:00
Karl-Aksel Puulmann bf482efe84
APIv2: Release `has_done`/`has_not_done` (#5285)
* APIv2: Release `has_done`/`has_not_done`

* Update tests to mark new features publicly available
2025-04-08 07:13:18 +00:00
Karl-Aksel Puulmann f330182a68
Show year (if multi-year graph) in graph tooltips (#5279)
The graph ticks already had this feature, but this was missing from
tooltips. Hope this sparks some joy.

Basecamp ref: https://3.basecamp.com/5308029/buckets/36789884/card_tables/cards/7630914606
2025-04-07 06:30:49 +00:00
Adrian Gruntkowski a715ed2f32
Remove Editor->Admin site role conversion and limit permissions (#5210)
* Remove editor->admin mapping from Site Settings > People

* Restrict editor role and allow admin to update site role

* Disable actions in Site Settings > People for roles other than admin and owner

* Fix test

* Update labeling of guest members in CRM for clarity

* Update phrasing in other spots of UI

* Update CHANGELONG.md

* Revise team related banners displayed under Site Settings > People

* Fix permissions check for role update
2025-04-03 11:04:19 +00:00
Adrian Gruntkowski 75f1cd74e0
Update CHANGELOG.md with teams support (#5256) 2025-04-01 09:02:01 +00:00
RobertJoonas 7e248d07ca
Fix favicons for domains including a subfolder (#5258)
* fix favicons for subfolder domains

* changelog

* rename source -> domain
2025-04-01 08:08:01 +00:00
RobertJoonas 167ff65a69
Add top 3 pages to traffic spike email (#5251)
* improve traffic_change_notifier_test

* add top 3 pages to traffic spike email

* improve email layout

* changelog

* fix tests after layout change
2025-03-31 09:24:28 +00:00
RobertJoonas 8e0f618c91
Increase Conversion Rate precision by one decimal place (#5250)
* change cr and group_cr rounding precision

* fix tests

* changelog
2025-03-31 09:11:47 +00:00
RobertJoonas 1b4aefb7d2
Stop counting today in `7d` and `30d` periods + add `28d` and `90d` (#5240)
* change 7d and 30d periods in API v2

* change 7d and 30d periods in legacy API

* add 28d and 90d into the dashboard

* add tests

* add 28d and 90d to public API v2

* changelog

* npm run generate-types

* typo

* fix NPM test

* fix interval_test

* add P shortcut for last month

* hide last 30d from datepicker but keep keybind functional

* fix keybind hints

* Timex to Date + helpful comment

* prettier format

* adjust comment

* mention 30d -> 28d in changelog as well

* make period hidden param new default
2025-03-27 09:49:56 +00:00
RobertJoonas c7bf54325e
Fix visitors.csv vs main graph discrepancy (#5230)
* fix typo to stop logging error in test output

* add time:minute interval to internal api schema

* always get visitors and visits from sessions table when time:minute dimension used

* query-api generate types

* changelog update
2025-03-25 16:18:48 +00:00
Karl-Aksel Puulmann 539f4a3f98
Tracker script version reported to /api/event (#5198)
* WIP

* tracker_script_version over reportedVersion

Will make it easier to grep for this thing

* CHANGELOG.md

* Only add tracker/package.json in workflow commit

* chore: Bump tracker_script_version to 1

* Show tracker_script_version is reported in tracker tests

* Track `engagement_time` while accounting for time page is blurred (#5206)

Consider this scenario:
1. User opens page /blog
2. 3 seconds later, alt-tabs to another window
3. minute later, alt-tabs to the page and closes it

Previously, this would be reported as 1m03s engagement_time. Now this
would be reported as 3s engagement_time.

* remove redundant engagement cooldown (#5199)

---------

Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
2025-03-18 07:30:17 +00:00
Artur Pata f7b535df4b
Fix dashboard report behavior when goals are in segments - variant C (#5175)
* Replace GET /segments and GET /segments/:segment_id with server-rendered list, fix issue with dashboard report columns

* Remove WIP comments and throw earlier for invalid dashboard state

* Fix Segments details issue on public / shared link sites, add tests
2025-03-13 13:02:14 +00:00
Karl-Aksel Puulmann 6739269765
Add changelog entry on tracker script (#5188) 2025-03-13 09:42:30 +00:00