Skip to content

Consolidated view settings#5795

Merged
RobertJoonas merged 22 commits intomasterfrom
consolidated-site-settings
Nov 4, 2025
Merged

Consolidated view settings#5795
RobertJoonas merged 22 commits intomasterfrom
consolidated-site-settings

Conversation

@RobertJoonas
Copy link
Copy Markdown
Contributor

@RobertJoonas RobertJoonas commented Oct 10, 2025

Changes

image
  • Filter out the irrelevant site settings from consolidated view settings. It now looks like the screenshot above, with the following sections removed:
    • General > Domain Change
    • General > Review Installation
    • People (the whole section) - everyone in the team can access the consolidated view. No guests allowed.
    • Visibility (the whole section) - we decided to go with a very minimal configuration. See this basecamp comment for the related discussion.
    • Funnels - removed as per Marko's comment here
    • Integrations (the whole section) - Google Search Console can only be connected to a single domain. Looker studio is currently considered out of scope.
    • Imports/Exports - cannot import stats because there's no ingestion to a consolidated view, and the actual data belongs to children sites. The same should apply for imported data. For the same reason, a full CSV export is not available - it's only meant to be imported into another Plausible instance.
    • Shields (the whole section) removed. No ingestion means no need for shields
    • Danger Zone (the whole section) - Ownership cannot be transferred. There are no stats to reset. Deleting the site will not be possible -- only hiding it.

Tests

  • Automated tests have been added
  • This PR does not require tests

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

@aerosol aerosol mentioned this pull request Oct 19, 2025
8 tasks
@RobertJoonas RobertJoonas force-pushed the consolidated-site-settings branch from 7c48582 to 1004043 Compare November 3, 2025 10:49
@RobertJoonas RobertJoonas changed the title Consolidated site settings [WIP] Consolidated view settings Nov 3, 2025
Copy link
Copy Markdown
Member

@aerosol aerosol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it, @RobertJoonas, great work. Some suggestions inline. Once we follow up with route-level authentication enforcement this should be complete.

end

defp check_no_currency_if_consolidated(site, changeset) do
if not is_nil(Ecto.Changeset.get_field(changeset, :currency)) and
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The not is_nil seems to be unnecessary? Also flip the order of those predicates, so that we circuit break sooner.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on_ee do
defp site_id_filter(%Plausible.Site{} = site) do
if Plausible.Sites.consolidated?(site) do
site_ids = Plausible.ConsolidatedView.Cache.get(site.team.identifier)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if site.domain, while technically the same, would be more appropriate at this level. I'm thinking we could also change other call sites by the way. The reasoning being, we have access to the view-site itself, and the cache is built on per-site basis:

      select: %{
        consolidated_view_id: sc.domain,

Another thing is, are we going to lose the db connection if the query is sent over the wire with @max_sites_per_view? If so, this demands some clever approach or a compromise.

Try something like:

for i <- 1..15000, do: new_site(owner: u, domain: "crash-#{i}.example.com")

And refresh/restart the cache to see what happens.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense to lookup site_ids by domain instead of site.team.identifier. c675ec4

Another thing is, are we going to lose the db connection if the query is sent over the wire with @max_sites_per_view? If so, this demands some clever approach or a compromise.

Didn't quite catch what you're saying here? But I did try with 15k sites and it worked well. Even confirmed that if I send a pageview with props: %{author: "john"} to crash10000.com then it shows up nicely in the prop suggestions for the consolidated view.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I meant to check if the "props query" won't be too big with a huge list of site ids. But I understand you're confirming it's fine.

@RobertJoonas RobertJoonas marked this pull request as ready for review November 4, 2025 11:19
@RobertJoonas RobertJoonas changed the title [WIP] Consolidated view settings Consolidated view settings Nov 4, 2025
@RobertJoonas RobertJoonas requested a review from aerosol November 4, 2025 11:44
@RobertJoonas RobertJoonas added this pull request to the merge queue Nov 4, 2025
Merged via the queue into master with commit d0ba8f7 Nov 4, 2025
16 checks passed
@RobertJoonas RobertJoonas deleted the consolidated-site-settings branch November 4, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants