Commit Graph

9 Commits

Author SHA1 Message Date
Adam Rutkowski 26285a0636
Provide safeguards for regular/consolidated sites distinction (#5742)
* exclude consolidated views when counting/listing sites

* Use Teams.owned_sites/1 now that it excludes consolidated views

* Until we figure out better - make sites.consolidated virtual for CE

* Safeguard ingestion, update tests for gate keeper/site cache

* Ensure consolidated sites are excluded from helpscout counts

* Test that consolidated views are excluded from site listings

* Update tests for owned sites to ensure consolidated views are excluded

* Update CRM tests to exclude consolidated sites

* exclude consolidated sites from quota usage

* filter out conslolidated sites from deleting events background job

* exclude consolidated (change domain background job)

* retrieve non-consolidated sites only by default

* Ensure Site struct defines a default for `consolidated`

* Make `sites.consolidated` column available in CE

* Add missing test to reminder e-mails, consolidation is irrelevant here

* Do not send setup help e-mail for consolidated sites

* Ensure no setup success email is ever sent for consolidated sites

* Skip consolidated sites in legacy time on page cut off

* Add minor test to Sites.get_for_user/2

* Extend get_for_user/get_for_user! options signature

* Move test dir up

* Write tests for Sites.get_by_domain

* Minor DRY

* fix typos

* Provide Site.regular() and ConsolidatedView.sites() for querying

* Use Site.regular() in Repo.get_by() calls

* Fix typespecs

* Update missing Site.regular() filters

---------

Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
2025-09-23 09:32:11 +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 bb1db557a3
Set `timeout: :infinity` on streaming export (#5654) 2025-08-19 09:51:33 +00:00
Karl-Aksel Puulmann 0fcbcc3a8c
time-on-page: csv import/export support, preparation for release (#5274)
* CSV import/export support for time-on-page

Note only the new time-on-page metric is exported this way

* visibility check for graphing of time_on_page

* FE no longer receives/sends legacy_time_on_page_cutoff

* Remove current_user from exports

* Remove legacy_time_on_page_cutoff from query.include, make behavior work off of site.legacy_time_on_page_cutoff explicitly

* Remove dead function

* More current_user_id removals
2025-04-08 06:25:11 +00:00
RobertJoonas 3473910c97
Average Scroll Depth Metric: imported data (#4915)
* include scroll_depth in full pages export

* import scroll_depth from CSV

* query scroll depth from imported data

* fix ordering by scroll depth with imported data

* fix imported scroll depth query + more tests

* enable scroll depth in top stats with imported data

* add main graph test

* fix test and native scroll depth sum select

* Update lib/plausible/exports.ex

Co-authored-by: ruslandoga <doga.ruslan@gmail.com>

* adjust test

* adjust test to catch error

* export/import/count pageleave_visitors

* extract base_q in export_pages_q

* rename total_visitors to pageleave_visitors

---------

Co-authored-by: ruslandoga <doga.ruslan@gmail.com>
2025-01-07 10:59:26 +00:00
ruslandoga 52437e8df0
Handle cross-device file move (#4640)
* handle cross-device file move

* don't change tests

* rm all the time

* no need to rm if rename succeeds

* don't raise in after
2024-09-30 16:16:36 +00:00
Adrian Gruntkowski c1c03b729c
Reapply "Local CSV exports/imports and S3/UI updates (#3989)" (#3995) (#3996)
* Reapply "Local CSV exports/imports and S3/UI updates (#3989)" (#3995)

This reverts commit aee69e44c8.

* remove unused functions

* eh, that one was actually used

* ugh, they were both used

---------

Co-authored-by: ruslandoga <67764432+ruslandoga@users.noreply.github.com>
2024-04-11 09:15:01 +02:00
Adrian Gruntkowski aee69e44c8
Revert "Local CSV exports/imports and S3/UI updates (#3989)" (#3995)
This reverts commit 1a0cb52f95.
2024-04-09 21:26:23 +02:00
ruslandoga 1a0cb52f95
Local CSV exports/imports and S3/UI updates (#3989)
* local CSV exports/imports and S3 updates

* credo

* dialyzer

* refactor input columns

* fix ci minio/clickhouse tests

* Update lib/plausible_web/live/csv_export.ex

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

* fix date range filter in export_pages_q and process only pageviews

* remove toTimeZone(zero_timestamp) note

* use SiteImport.pending(), SiteImport.importing()

* escape [SiteImport.pending(), SiteImport.importing()]

* use random s3 keys for imports to avoid collisions (sometimes makes the upload get stuck)

* clamp import date ranges

* site is already in assigns

* recompute cutoff date each time

* use toDate(timestamp[, timezone]) shortcut

* show alreats on export cancel/delete and extract hint into a component

* switch to Imported.clamp_dates/4

* reprocess tables when imports are added

* recompute cutoff_date on each call

* actually use clamped_date_range on submit

* add warning message

* add expiry rules to buckets in make minio

* add site_id to imports notifications and use it in csv_importer

* try/catch safer

* return :ok

* date range is not available when no uploads

* improve ui and warning messages

* use Generic.notice

* fix flaky exports test

* begin tests

* Improve `Importer` notification payload shape

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-04-09 20:59:48 +02:00