Commit Graph

3889 Commits

Author SHA1 Message Date
Artur Pata a44ce24867
Fix tracker script config backfill (#5860) 2025-11-03 13:31:25 +00:00
Sanne de Vries d7c641e6a6
Move shared link form to modal (#5849)
* Move shared link form to modal

- As a preliminary step for enabling adding a pinned segment to a shared link, the functionality to add or edit a shared link is being moved to a modal.
- Minor UI improvements, such as update the style of the edit and delete buttons.

* Update tests

- Add shared_link_settings_test.exs for LiveView interactions (deletion, errors)
- Add shared_link_settings/form_test.exs for modal form testing (create, edit, validation)
- Update controller tests: remove deleted actions, update visibility test

* Update lib/plausible_web/components/generic.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* Update lib/plausible_web/components/generic.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* Refactor icon button components

* Fix spelling error

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2025-11-03 12:51:04 +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 51ce8a41b5
Fix migration for CE 3.0.1 to current (#5844)
* Fix migration for CE

* Remove dead code
2025-11-03 10:22:22 +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
Artur Pata a204c89066
Stop trying to compile detector and verifier on CE (#5857) 2025-11-03 09:22:55 +00:00
Adrian Gruntkowski 0405055f95
Improve HelpScout integration layout (#5853) 2025-10-31 14:36:25 +00:00
apata 2ad3c18f76 Released tracker script version 0.4.4 2025-10-31 08:01:23 +00:00
Artur Pata c9cbea7cd8
Add JSDoc types (#5842)
* Enhance TypeScript definitions for Plausible tracking library

Updated the plausible.d.ts file to improve documentation by adding JSDoc comments for all functions and properties. This enhances clarity and usability for developers integrating the tracking library.

* Update CHANGELOG.md to reflect changes in TypeScript definition comments for improved IDE integration

* Format

* Remove subtitle from changelog

---------

Co-authored-by: Ahmed Hassanein <eng.a7mad.gamal@gmail.com>
2025-10-31 07:56:01 +00:00
Marko Saric 546f0c3cdf
Update the onboarding email copy (#5789)
* Update site_setup_help_email.html.heex

* Update welcome_email.html.heex

* Update create_site_email.html.heex

* Fix formatting

* Fix flakiness due to sync persistor tests not cleaning up

* Update tests

* Fix CE tests

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2025-10-30 14:32:19 +00:00
RobertJoonas d1b6817cfe
Change domain flow improvements (#5850)
* add opts to Check.perform signature

* increase domain change detection timeout to 11s

* same footer after submit + docs link

* domain change flow improvements

* fix for CE

* fix link

* rename to @plausible-analytics/tracker

* change icon
2025-10-30 11:17:54 +00:00
Sanne de Vries ce424bf436
Update site switcher UI to accommodate for consolidated view (#5838)
* Update site switcher UI to accommodate for consolidated view

* Implement logic to display consolidated view in site picker

* Fix "All sites" selected state in site switcher

* Fixup tests

* Include consolidated view assigns in shared links

* Format

* Extract `ConsolidatedView.ok_to_display?/2`

* Format

* I'll pretend no one saw this

* Skip unnecessary `on_ee`

* oops

---------

Co-authored-by: Adam Rutkowski <hq@mtod.org>
2025-10-29 10:58:45 +00:00
Sanne de Vries 638a59b8f5
Add border to tab component (#5848)
- Update tab component visually for extra affordance
2025-10-29 08:34:22 +00:00
Artur Pata 59839d2fd8
Declare favicon external resource properly (#5841) 2025-10-28 11:24:49 +00:00
Artur Pata 89c8cb3485
Make graphs dependant on centrally determined theme (#5840) 2025-10-28 11:18:25 +00:00
dependabot[bot] 2a5850aff0
Bump actions/setup-node from 5 to 6 (#5813)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cenk Kücük <cenk@plausible.io>
2025-10-28 10:58:15 +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
dependabot[bot] 5754f2be6b
Bump actions/download-artifact from 5 to 6 (#5829)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 09:29:07 +00:00
dependabot[bot] 1eda271438
Bump actions/upload-artifact from 4 to 5 (#5830)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 09:28:33 +00:00
Artur Pata 2a6720cbfa
Update deps (#5837)
* Update playwright to 1.56.1

* chore: Bump tracker_script_version to 33

* Run audit fix for /assets

---------

Co-authored-by: apata <apata@users.noreply.github.com>
2025-10-28 08:44:42 +00:00
Sanne de Vries 91363a2825
Improve dark mode (#5819)
* Improve dark mode

- Switch from `slate` to `zinc` for the gray color palette
- Darken overall dark mode UI
- Switch from `green` to `emerald` for the green color palette
- Update a few previously missed instances of title case to sentence case
- Consolidate button styles and change naming from `bright` to `secondary`
- Update button disabled styles
- Fix tooltip not adjusting to content width
- Update graph tooltip layout and typography
- Add transition effects to hover states
- Reduce footer logo size

* Fix oversights

- Update funnel graph colors
- Update graph grid colors
- Improve focus styles
- Improve disabled input styles

* Fix more oversights in relation to dashboard filtering

- Improve consistency of input, button, combobox and modal components in relation to settings area
- Fix segment tooltip color

* Fix search input style in funnel and segments dropdowns

* Add white background to favicon images in dark mode

- The GitHub and ChatGPT favicons are hard to see in dark mode, so we add a white background to them.

* Fix tooltip color to fit all backgrounds in dark mode

* Fix tests

* Fixed more tests

* Extract SourceFavicon component to eliminate favicon duplication

* Fix regression on installation page after rebase

* Fix formatting issues

* Fix favicon test failure in CI by reading placeholder icon at compile time

* Undo previous commit
2025-10-28 08:28:15 +00:00
RobertJoonas 46f05d81c9
Verification / Detection follow-ups (#5836)
* make timeout configurable for a check via check_opts

* add an internal_check_timeout test case to verification/checks_test.exs

* move verification observability tests to a separate file

... make it sync and test capturing Sentry events too

* separate detection observability checks too

* test sentry events in detection

* consider internal check timeouts browserless issues in detection too

* test util function defs to ee_only
2025-10-27 16:50:54 +00:00
Adam Rutkowski fc34357865
CRM: 24h charts + minor extensions (#5832)
* Display 24h charts in CRM

* Move New Custom Plan button to the top of the page

* Allow custom plan deletion

* Add managed proxy price modifier to custom plan estimation
2025-10-27 14:29:11 +00:00
Adam Rutkowski 7de63a01ae
Set Consolidated View's timezone to what majority of sites has (#5834)
* Set Consolidated View's timezone to what majority of sites has

* clean up
2025-10-27 14:28:39 +00:00
Adam Rutkowski ce02ab0799
Crop big consolidated views (#5835)
* Crop big consolidated views

* number format
2025-10-27 13:01:17 +00:00
Artur Pata 0e0415fd6b
Broadcast tracker script config updates (#5806)
* Broadcast tracker script config updates

* Fix broadcast_put typespec

* Preload site association on CE

* Stop preloading uselessly

* Reload tracker_script_config on CE only
2025-10-27 10:48:06 +00:00
RobertJoonas 7540511deb
Clean up detection sentry events + tests (#5833)
* add module name to service_error when check times out

Otherwise, it can sometimes remain unclear in the diagnostics, whether
it was InstallationV2 or InstallationV2CacheBust that timed out.

* Remove duplicate timeout logic

The current production logs show two types of verification timeouts:

* service_error: "Unhandled Browserless response status: 408" (vast
  majority of cases)
* service_error: :timeout (only a few cases)

The latter happens when we hit the Req receive_timeout
(endpoint_timeout + 2s). I've seen Browserless not respect the timeout
param from time to time, so it's better to keep the timeout logic
"in-house" only.

* make service_error into a map with code and extra

* interpret temporary service errors

...but still consider them "unhandled" for telemetry, also notifying Sentry
and logging the warning.

* separate sentry messages (verification)

* make Verification.ChecksTest more DRY

* organize tests into describe blocks

* test verification telemetry and logging

* fix codespell

* get rid of legacy verification

* rename Checks.InstallationV2 -> Checks.VerifyInstallation

* delete Live.Installation and rename Live.InstallationV2 -> Live.Installation

* rename installationv2 (live) files as well

* delete old change-domain routes

Also rename current liveview modules and routes, removing the v2 suffix

* rename domain_change_v2 files, removing v2 suffix

* remove legacy JS verifier code

Also fix dockerignore and elixir.yml referencing a wrong priv path

* rename verification_v2_test -> verification_test

* remove v2 prefix from logs and sentry messages

* clean up duplicate external_sites_controller_test.exs tests

* remove flag

* fix typespec

* pass timeout as query param to Browserless too

* Fixup external sites controller test module (#5826)

* fix test description

* clean up detection sentry events + tests

* improve naming

---------

Co-authored-by: Artur Pata <artur.pata@gmail.com>
2025-10-27 10:31:24 +00:00
RobertJoonas a83b4f3583
Clean up legacy verification code and script v2 flag (#5824)
* add module name to service_error when check times out

Otherwise, it can sometimes remain unclear in the diagnostics, whether
it was InstallationV2 or InstallationV2CacheBust that timed out.

* Remove duplicate timeout logic

The current production logs show two types of verification timeouts:

* service_error: "Unhandled Browserless response status: 408" (vast
  majority of cases)
* service_error: :timeout (only a few cases)

The latter happens when we hit the Req receive_timeout
(endpoint_timeout + 2s). I've seen Browserless not respect the timeout
param from time to time, so it's better to keep the timeout logic
"in-house" only.

* make service_error into a map with code and extra

* interpret temporary service errors

...but still consider them "unhandled" for telemetry, also notifying Sentry
and logging the warning.

* separate sentry messages (verification)

* make Verification.ChecksTest more DRY

* organize tests into describe blocks

* test verification telemetry and logging

* fix codespell

* get rid of legacy verification

* rename Checks.InstallationV2 -> Checks.VerifyInstallation

* delete Live.Installation and rename Live.InstallationV2 -> Live.Installation

* rename installationv2 (live) files as well

* delete old change-domain routes

Also rename current liveview modules and routes, removing the v2 suffix

* rename domain_change_v2 files, removing v2 suffix

* remove legacy JS verifier code

Also fix dockerignore and elixir.yml referencing a wrong priv path

* rename verification_v2_test -> verification_test

* remove v2 prefix from logs and sentry messages

* clean up duplicate external_sites_controller_test.exs tests

* remove flag

* fix typespec

* pass timeout as query param to Browserless too

* Fixup external sites controller test module (#5826)

* fix test description

---------

Co-authored-by: Artur Pata <artur.pata@gmail.com>
2025-10-27 09:39:41 +00:00
RobertJoonas ad2c8e8e39
Verification Fixes (#5822)
* add module name to service_error when check times out

Otherwise, it can sometimes remain unclear in the diagnostics, whether
it was InstallationV2 or InstallationV2CacheBust that timed out.

* Remove duplicate timeout logic

The current production logs show two types of verification timeouts:

* service_error: "Unhandled Browserless response status: 408" (vast
  majority of cases)
* service_error: :timeout (only a few cases)

The latter happens when we hit the Req receive_timeout
(endpoint_timeout + 2s). I've seen Browserless not respect the timeout
param from time to time, so it's better to keep the timeout logic
"in-house" only.

* make service_error into a map with code and extra

* interpret temporary service errors

...but still consider them "unhandled" for telemetry, also notifying Sentry
and logging the warning.

* separate sentry messages (verification)

* make Verification.ChecksTest more DRY

* organize tests into describe blocks

* test verification telemetry and logging

* fix codespell

* pass timeout as query param to Browserless too
2025-10-27 09:17:15 +00:00
Adrian Gruntkowski f3ccfde980
Adjust persistor metrics buckets and remove decode measurement (#5831) 2025-10-27 08:12:09 +00:00
Artur Pata 51b56f496d
Fix 2FA disable dialog (#5827) 2025-10-24 15:25:57 +00:00
Artur Pata 49317f57fc
Stop docs info icon hovering over account menu (#5823) 2025-10-24 11:04:21 +00:00
Uku Taht 9e3102d819
Add controller-level tests for timezone handling in Query (#5809)
* Add tests for query timezones

* Test timezones at controller level

* Remove v1 controller tests for ambigous times

* Add tests for legacy_time_on_page_cutoff

* Add test for generic cutoff timezone behaviour without gaps
2025-10-23 13:25:36 +00:00
Adrian Gruntkowski 0abad8b0ab
Add metric for decode duration in remote persistor client (#5821) 2025-10-23 11:52:27 +00:00
Adrian Gruntkowski d1c5f19e3c
Explicitly enable Nagle's algorithm for persistor HTTP client (#5820) 2025-10-23 07:28:52 +00:00
Adam Rutkowski bce08903e5
Integrate consolidated view UI (#5798)
* Create static consolidated view UI on `/sites` page

- Improve existing site card layout
- Add static UI for the consolidated view
- Add dismissable upgrade card UI
- Extract favicon fetching logic to function
- Configure configurable fallback icon per route
- Add `/favicon/sources_globe/` route with different icon than `/favicon/sources/` to use on `/sites` page

* Improve the mobile view of the `/sites` page

* Minor query interface UX extension (#5713)

* Minor query interface extension

* !fixup

* !fixup

* Initial implementation of consolidated views on /sites

* Improve loading state

* no need to handle nil in main interface

* Juggle `can_manage_consolidated_view?`

* Require team setup in order to enable consolidated view

* nil catcher

* Fixup test fixture

* Don't show Consolidated View tab in CS if team is not setup

* Reorganize + test

* Remove comment

* Only show consolidated views to superadmins for now

* Remove temporary sleep

* CE unused bindings

* Clean up seeds

* EE

* Fixup test

* Test non-superadmin scenario

* Add a test guarding parity between small plots (consolidated vs individual)

* Move private function so CE won't complain

* See if the graphs are now similar at least :)

* sort

* Map keys are unsorted

* Ensure engagement events aren't counted as visitors on smol graphs

* just try and revert

* Revert "just try and revert"

This reverts commit 7584f59816.

* Simplify globe icon handling

* Remove unnecessary @rest

* Split tests into more focused cases

* Address jumpiness on furious refresh cycle

* Revert "Address jumpiness on furious refresh cycle"

This reverts commit 5c03b36918.

* Another attempt at jumpiness

* Enforce less noticeable lag applying the diff from loading to loaded

* Reduce flashing on stats load

---------

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2025-10-22 10:58:26 +00:00
Artur Pata f01ce1b1b6
Script v2: Identify detection attempt (#5818)
* Identify detection attempt

* Test Detection.Checks module

* Fix typo
2025-10-22 10:16:54 +00:00
Adrian Gruntkowski 559c07d2d2
Use embed-friendly secure headers for HelpScout integration endpoints (#5817) 2025-10-21 11:16:43 +00:00
Adrian Gruntkowski 80244e5dad
Avoid crashing telemetry handler for persistor on recv Finch errors (#5815) 2025-10-20 12:20:57 +00:00
Adrian Gruntkowski 3d1f1eca8e
Ensure `conn` from `Plug.Conn.read_body` is always passed down the pipeline (#5814)
* Ensure `conn` from `Plug.Conn.read_body` is always passed down the pipeline

* Alter persistor related histogram metrics for better view of timings

* Update typespec
2025-10-20 11:54:52 +00:00
Adam Rutkowski 5976a6ae6a
Sampling Cache: ensure consolidated values are reported; cache all sites, not only >threshold (#5783)
* Sampling Cache: ensure consolidated values above threshold are reported

* Calculate fractional sampling regardless of cached traffic record

* Fix alias
2025-10-20 11:08:00 +00:00
Artur Pata 6b1821362f
Start passing official installs that are using legacy .compat script (#5812)
* Start passing official installs that are using legacy .compat installation

* Pass the first domain for verifying legacy compat installs

* Fix variable access issue

* Fix non-existent function call

* Comment why split domainString
2025-10-16 15:53:18 +00:00
Adrian Gruntkowski daf1c1a9cd
Measure total `Persistor.Remote` request duration, outside `Finch` (#5811) 2025-10-16 13:03:23 +00:00
RobertJoonas cef947e02c
Fix cache bust verification + function clause service error (#5808)
* do not use cache bust url in initial installaton check

* make installation_v2_cache_bust replace diagnostics, not add them

The test added in this commit also surfaced the function clause error
encountered on prod. This is also fixed in this commit by making sure
delays are given to Req retries as integers, rather than floats.

* assert_matches
2025-10-16 08:25:47 +00:00
Uku Taht 46000fd4bc
Implement custom date/time range comparisons (#5805)
* Implement custom date/time range comparisons

* Update ts schema

* Use Etc/UTC, not UTC - timezone shifted structs are differrent otherwise

* Remove debug statement

* Adjusts timezone in tests

---------

Co-authored-by: Adam Rutkowski <hq@mtod.org>
2025-10-16 06:14:49 +00:00
Artur Pata 4ecd3cf8f5
Fix test suites that are async and shouldn't be (#5807) 2025-10-15 06:05:46 +00:00
Artur Pata 7b4d86f4bc
Retry on 408 timeout from Browserless.io (#5800)
* Retry on 408 timeout from Browserless.io

* Make Browserless retries configurable

* Override ignoring events

* Refactor
2025-10-14 12:17:51 +00:00
Artur Pata 3eeab00273
Make sure undefined callbackResult (ignored event) is visible in logs (#5802) 2025-10-14 08:54:20 +00:00
Artur Pata 5b82979bfa
Change timeouts (#5799)
* Change timeouts

* Fix timeout

* Add tests

* Change number format
2025-10-13 13:05:25 +00:00
Adrian Gruntkowski cd68b43d0a
Put params in URL for GET Paddle API request instead of body (#5797) 2025-10-12 10:16:48 +00:00