Skip to content

feat(web-analytics): Add Web Analytics Digest Email Job#52785

Merged
jordanm-posthog merged 20 commits intomasterfrom
jordanm-posthog/addWADigest
Apr 13, 2026
Merged

feat(web-analytics): Add Web Analytics Digest Email Job#52785
jordanm-posthog merged 20 commits intomasterfrom
jordanm-posthog/addWADigest

Conversation

@jordanm-posthog
Copy link
Copy Markdown
Contributor

@jordanm-posthog jordanm-posthog commented Mar 30, 2026

Problem

Users have no way to get an overview of this site's analytics week to week.

Changes

Adds new email job that queries stats and send the email to opted-in users.
image
image

How it works

New Temporal workflow:

  • Activity wa-digest-get-orgs lists all organizations and filters by the web-analytics-weekly-digest feature flag
  • Fans out one wa-digest-build-and-send-for-org activity per valid org

Per org:

  • Short-circuits if email isn't configured.
  • Loads org memberships and filters by the same feature flag at the user distinct-id level
  • Loads all org teams and builds one digest per team (reused across users)

Per team digest :

  • WebOverviewQuery: visitors, pageviews, sessions, bounce rate, avg session duration
  • WebStatsTableQuery: top pages
  • WebStatsTableQuery: top sources
  • WebGoalsQuery: goal conversions

Per user:

  • Skip if opted out of the web_analytics_weekly_digest notification
  • Filter teams to those the user has access to via UserPermissions
  • If the user has no project preferences configured, auto-select the project with the most visitors
  • Apply per-project notification settings and split into enabled / disabled lists
  • Skip if no enabled projects remain

How did you test this code?

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Publish to changelog?

Docs update

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 30, 2026

Size Change: +7.2 kB (+0.01%)

Total Size: 129 MB

Filename Size Change
frontend/dist/exporter.js 20.9 MB +1.44 kB (+0.01%)
frontend/dist/render-query 20.6 MB +1.44 kB (+0.01%)
frontend/dist/render-query.js 20.6 MB +1.44 kB (+0.01%)
frontend/dist/toolbar 10.6 MB +1.44 kB (+0.01%)
frontend/dist/toolbar.js 10.6 MB +1.44 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
frontend/dist/368Hedgehogs 5.26 kB
frontend/dist/abap 14.2 kB
frontend/dist/AccountSocialConnected 1.62 kB
frontend/dist/Action 23.2 kB
frontend/dist/Actions 1.02 kB
frontend/dist/AdvancedActivityLogsScene 34 kB
frontend/dist/AgenticAuthorize 5.25 kB
frontend/dist/apex 3.95 kB
frontend/dist/ApprovalDetail 16.2 kB
frontend/dist/array.full.es5.js 332 kB
frontend/dist/array.full.js 427 kB
frontend/dist/array.js 183 kB
frontend/dist/AsyncMigrations 13.1 kB
frontend/dist/AuthorizationStatus 716 B
frontend/dist/azcli 846 B
frontend/dist/bat 1.84 kB
frontend/dist/BatchExportScene 60.3 kB
frontend/dist/bicep 2.55 kB
frontend/dist/Billing 493 B
frontend/dist/BillingSection 20.8 kB
frontend/dist/BoxPlot 5.04 kB
frontend/dist/browserAll-0QZMN1W2 37.4 kB
frontend/dist/ButtonPrimitives 562 B
frontend/dist/CalendarHeatMap 4.79 kB
frontend/dist/cameligo 2.18 kB
frontend/dist/changeRequestsLogic 544 B
frontend/dist/CLIAuthorize 11.3 kB
frontend/dist/CLILive 3.97 kB
frontend/dist/clojure 9.64 kB
frontend/dist/coffee 3.59 kB
frontend/dist/Cohort 23.2 kB
frontend/dist/CohortCalculationHistory 6.22 kB
frontend/dist/Cohorts 9.39 kB
frontend/dist/ConfirmOrganization 4.48 kB
frontend/dist/conversations.js 65.8 kB
frontend/dist/Coupons 720 B
frontend/dist/cpp 5.3 kB
frontend/dist/Create 655 B
frontend/dist/crisp-chat-integration.js 1.88 kB
frontend/dist/csharp 4.52 kB
frontend/dist/csp 1.42 kB
frontend/dist/css 4.51 kB
frontend/dist/cssMode 4.15 kB
frontend/dist/CustomCssScene 3.55 kB
frontend/dist/CustomerAnalyticsConfigurationScene 1.99 kB
frontend/dist/CustomerAnalyticsScene 26.4 kB
frontend/dist/CustomerJourneyBuilderScene 1.69 kB
frontend/dist/CustomerJourneyTemplatesScene 7.39 kB
frontend/dist/customizations.full.js 17.9 kB
frontend/dist/CyclotronJobInputAssignee 1.32 kB
frontend/dist/CyclotronJobInputTicketTags 711 B
frontend/dist/cypher 3.38 kB
frontend/dist/dart 4.25 kB
frontend/dist/Dashboard 1.11 kB
frontend/dist/Dashboards 23.1 kB
frontend/dist/DataManagementScene 646 B
frontend/dist/DataPipelinesNewScene 2.28 kB
frontend/dist/DataWarehouseScene 1.21 kB
frontend/dist/DataWarehouseSourceScene 634 B
frontend/dist/Deactivated 1.13 kB
frontend/dist/dead-clicks-autocapture.js 13.1 kB
frontend/dist/DeadLetterQueue 5.38 kB
frontend/dist/DebugScene 20 kB
frontend/dist/decompressionWorker 2.85 kB
frontend/dist/decompressionWorker.js 2.85 kB
frontend/dist/DefinitionEdit 7.11 kB
frontend/dist/DefinitionView 22.7 kB
frontend/dist/DestinationsScene 2.67 kB
frontend/dist/dist 575 B
frontend/dist/dockerfile 1.87 kB
frontend/dist/EarlyAccessFeature 753 B
frontend/dist/EarlyAccessFeatures 2.84 kB
frontend/dist/ecl 5.33 kB
frontend/dist/EditorScene 896 B
frontend/dist/elixir 10.3 kB
frontend/dist/elk.bundled 1.44 MB
frontend/dist/EmailMFAVerify 2.98 kB
frontend/dist/EndpointScene 37.5 kB
frontend/dist/EndpointsScene 22.1 kB
frontend/dist/ErrorTrackingConfigurationScene 2.2 kB
frontend/dist/ErrorTrackingIssueFingerprintsScene 6.98 kB
frontend/dist/ErrorTrackingIssueScene 81.7 kB
frontend/dist/ErrorTrackingScene 12.9 kB
frontend/dist/EvaluationTemplates 575 B
frontend/dist/EventsScene 2.46 kB
frontend/dist/exception-autocapture.js 11.8 kB
frontend/dist/Experiment 208 kB
frontend/dist/Experiments 17.7 kB
frontend/dist/exporter 20.9 MB
frontend/dist/ExportsScene 3.86 kB
frontend/dist/FeatureFlag 128 kB
frontend/dist/FeatureFlags 606 B
frontend/dist/FeatureFlagTemplatesScene 7.03 kB
frontend/dist/FlappyHog 5.78 kB
frontend/dist/flow9 1.8 kB
frontend/dist/freemarker2 16.7 kB
frontend/dist/fsharp 2.98 kB
frontend/dist/go 2.65 kB
frontend/dist/graphql 2.26 kB
frontend/dist/Group 14.4 kB
frontend/dist/Groups 3.91 kB
frontend/dist/GroupsNew 7.34 kB
frontend/dist/handlebars 7.34 kB
frontend/dist/hcl 3.59 kB
frontend/dist/HealthCategoryDetailScene 7.23 kB
frontend/dist/HealthScene 10.3 kB
frontend/dist/HeatmapNewScene 4.16 kB
frontend/dist/HeatmapRecordingScene 3.92 kB
frontend/dist/HeatmapScene 5.88 kB
frontend/dist/HeatmapsScene 3.88 kB
frontend/dist/hls 394 kB
frontend/dist/HogFunctionScene 58.7 kB
frontend/dist/HogRepl 7.37 kB
frontend/dist/html 5.58 kB
frontend/dist/htmlMode 4.62 kB
frontend/dist/image-blob-reduce.esm 49.4 kB
frontend/dist/InboxScene 59.7 kB
frontend/dist/index 308 kB
frontend/dist/index.js 308 kB
frontend/dist/ini 1.1 kB
frontend/dist/InsightOptions 5.41 kB
frontend/dist/InsightScene 28.9 kB
frontend/dist/IntegrationsRedirect 733 B
frontend/dist/intercom-integration.js 1.93 kB
frontend/dist/InviteSignup 14.4 kB
frontend/dist/java 3.22 kB
frontend/dist/javascript 985 B
frontend/dist/jsonMode 13.9 kB
frontend/dist/julia 7.22 kB
frontend/dist/kotlin 3.4 kB
frontend/dist/lazy 150 kB
frontend/dist/LegacyPluginScene 26.6 kB
frontend/dist/LemonTextAreaMarkdown 502 B
frontend/dist/less 3.9 kB
frontend/dist/lexon 2.44 kB
frontend/dist/lib 2.22 kB
frontend/dist/Link 468 B
frontend/dist/LinkScene 24.8 kB
frontend/dist/LinksScene 4.19 kB
frontend/dist/liquid 4.53 kB
frontend/dist/LiveDebugger 19.1 kB
frontend/dist/LiveEventsTable 2.98 kB
frontend/dist/LLMAnalyticsClusterScene 15.7 kB
frontend/dist/LLMAnalyticsClustersScene 43.1 kB
frontend/dist/LLMAnalyticsDatasetScene 19.7 kB
frontend/dist/LLMAnalyticsDatasetsScene 3.28 kB
frontend/dist/LLMAnalyticsEvaluation 41.7 kB
frontend/dist/LLMAnalyticsEvaluationsScene 29.5 kB
frontend/dist/LLMAnalyticsPlaygroundScene 36.3 kB
frontend/dist/LLMAnalyticsScene 117 kB
frontend/dist/LLMAnalyticsSessionScene 13.4 kB
frontend/dist/LLMAnalyticsTraceScene 127 kB
frontend/dist/LLMAnalyticsUsers 526 B
frontend/dist/LLMASessionFeedbackDisplay 4.83 kB
frontend/dist/LLMPromptScene 20.6 kB
frontend/dist/LLMPromptsScene 4.21 kB
frontend/dist/Login 8.57 kB
frontend/dist/Login2FA 4.2 kB
frontend/dist/logs.js 38.5 kB
frontend/dist/LogsScene 11.3 kB
frontend/dist/lua 2.11 kB
frontend/dist/m3 2.81 kB
frontend/dist/main 819 kB
frontend/dist/ManagedMigration 14 kB
frontend/dist/markdown 3.79 kB
frontend/dist/MarketingAnalyticsScene 39.7 kB
frontend/dist/MaterializedColumns 10.2 kB
frontend/dist/Max 835 B
frontend/dist/mdx 5.39 kB
frontend/dist/memlens.lib.bundle 27.8 kB
frontend/dist/MessageTemplate 16.3 kB
frontend/dist/MetricsScene 828 B
frontend/dist/mips 2.58 kB
frontend/dist/ModelsScene 13.6 kB
frontend/dist/MonacoDiffEditor 403 B
frontend/dist/monacoEditorWorker 288 kB
frontend/dist/monacoEditorWorker.js 288 kB
frontend/dist/monacoJsonWorker 419 kB
frontend/dist/monacoJsonWorker.js 419 kB
frontend/dist/monacoTsWorker 7.02 MB
frontend/dist/monacoTsWorker.js 7.02 MB
frontend/dist/MoveToPostHogCloud 4.46 kB
frontend/dist/msdax 4.91 kB
frontend/dist/mysql 11.3 kB
frontend/dist/NavTabChat 4.68 kB
frontend/dist/NewSourceWizard 724 B
frontend/dist/NewTabScene 681 B
frontend/dist/NodeDetailScene 16.3 kB
frontend/dist/NotebookCanvasScene 3.2 kB
frontend/dist/NotebookPanel 5.21 kB
frontend/dist/NotebookScene 8.21 kB
frontend/dist/NotebooksScene 7.58 kB
frontend/dist/OAuthAuthorize 573 B
frontend/dist/objective-c 2.41 kB
frontend/dist/Onboarding 687 kB
frontend/dist/OnboardingCouponRedemption 1.2 kB
frontend/dist/pascal 2.99 kB
frontend/dist/pascaligo 2 kB
frontend/dist/passkeyLogic 484 B
frontend/dist/PasswordReset 4.32 kB
frontend/dist/PasswordResetComplete 2.94 kB
frontend/dist/perl 8.25 kB
frontend/dist/PersonScene 16.1 kB
frontend/dist/PersonsScene 4.68 kB
frontend/dist/pgsql 13.5 kB
frontend/dist/php 8.02 kB
frontend/dist/PipelineStatusScene 6.22 kB
frontend/dist/pla 1.67 kB
frontend/dist/posthog 137 kB
frontend/dist/postiats 7.86 kB
frontend/dist/powerquery 16.9 kB
frontend/dist/powershell 3.27 kB
frontend/dist/PreflightCheck 5.53 kB
frontend/dist/product-tours.js 115 kB
frontend/dist/ProductTour 273 kB
frontend/dist/ProductTours 4.68 kB
frontend/dist/ProjectHomepage 24.7 kB
frontend/dist/protobuf 9.05 kB
frontend/dist/pug 4.82 kB
frontend/dist/python 4.76 kB
frontend/dist/qsharp 3.19 kB
frontend/dist/QueryPerformance 3.44 kB
frontend/dist/r 3.12 kB
frontend/dist/razor 9.35 kB
frontend/dist/recorder-v2.js 111 kB
frontend/dist/recorder.js 111 kB
frontend/dist/redis 3.55 kB
frontend/dist/redshift 11.8 kB
frontend/dist/RegionMap 29.4 kB
frontend/dist/ResourceTransfer 9.17 kB
frontend/dist/restructuredtext 3.9 kB
frontend/dist/RevenueAnalyticsScene 25.6 kB
frontend/dist/ruby 8.5 kB
frontend/dist/rust 4.16 kB
frontend/dist/SavedInsights 664 B
frontend/dist/sb 1.82 kB
frontend/dist/scala 7.32 kB
frontend/dist/scheme 1.76 kB
frontend/dist/scss 6.41 kB
frontend/dist/SdkDoctorScene 9.4 kB
frontend/dist/SessionAttributionExplorerScene 6.62 kB
frontend/dist/SessionGroupSummariesTable 4.62 kB
frontend/dist/SessionGroupSummaryScene 17 kB
frontend/dist/SessionProfileScene 15.8 kB
frontend/dist/SessionRecordingDetail 1.73 kB
frontend/dist/SessionRecordingFilePlaybackScene 4.46 kB
frontend/dist/SessionRecordings 742 B
frontend/dist/SessionRecordingsKiosk 8.84 kB
frontend/dist/SessionRecordingsPlaylistScene 4.14 kB
frontend/dist/SessionRecordingsSettingsScene 1.9 kB
frontend/dist/SessionsScene 3.86 kB
frontend/dist/SettingsScene 2.98 kB
frontend/dist/SharedMetric 4.83 kB
frontend/dist/SharedMetrics 549 B
frontend/dist/shell 3.07 kB
frontend/dist/SignupContainer 24.5 kB
frontend/dist/Site 1.18 kB
frontend/dist/solidity 18.6 kB
frontend/dist/sophia 2.76 kB
frontend/dist/SourcesScene 5.96 kB
frontend/dist/sourceWizardLogic 662 B
frontend/dist/sparql 2.55 kB
frontend/dist/sql 10.3 kB
frontend/dist/SqlVariableEditScene 7.24 kB
frontend/dist/st 7.4 kB
frontend/dist/StartupProgram 21.2 kB
frontend/dist/SubscriptionsScene 16.4 kB
frontend/dist/SupportSettingsScene 1.16 kB
frontend/dist/SupportTicketScene 23.4 kB
frontend/dist/SupportTicketsScene 733 B
frontend/dist/Survey 848 B
frontend/dist/SurveyFormBuilder 1.54 kB
frontend/dist/Surveys 18.2 kB
frontend/dist/surveys.js 90 kB
frontend/dist/SurveyWizard 64.2 kB
frontend/dist/swift 5.26 kB
frontend/dist/SystemStatus 16.8 kB
frontend/dist/systemverilog 7.61 kB
frontend/dist/TaskDetailScene 21.5 kB
frontend/dist/TaskTracker 13.2 kB
frontend/dist/tcl 3.57 kB
frontend/dist/TextCardMarkdownEditor 11 kB
frontend/dist/ToolbarLaunch 2.52 kB
frontend/dist/tracing-headers.js 1.74 kB
frontend/dist/TracingScene 29.4 kB
frontend/dist/TransformationsScene 1.91 kB
frontend/dist/tsMode 24 kB
frontend/dist/twig 5.97 kB
frontend/dist/TwoFactorReset 3.98 kB
frontend/dist/typescript 240 B
frontend/dist/typespec 2.82 kB
frontend/dist/Unsubscribe 1.62 kB
frontend/dist/UserInterview 4.53 kB
frontend/dist/UserInterviews 2.01 kB
frontend/dist/vb 5.79 kB
frontend/dist/VercelConnect 4.95 kB
frontend/dist/VercelLinkError 1.91 kB
frontend/dist/VerifyEmail 4.48 kB
frontend/dist/vimMode 211 kB
frontend/dist/VisualReviewRunScene 18.6 kB
frontend/dist/VisualReviewRunsScene 6.16 kB
frontend/dist/VisualReviewSettingsScene 10.8 kB
frontend/dist/web-vitals.js 6.39 kB
frontend/dist/WebAnalyticsScene 5.77 kB
frontend/dist/WebGLRenderer-DYjOwNoG 60.3 kB
frontend/dist/WebGPURenderer-B_wkl_Ja 36.3 kB
frontend/dist/WebScriptsScene 2.54 kB
frontend/dist/webworkerAll-puPV1rBA 324 B
frontend/dist/wgsl 7.34 kB
frontend/dist/Wizard 4.45 kB
frontend/dist/WorkflowScene 102 kB
frontend/dist/WorkflowsScene 46.9 kB
frontend/dist/WorldMap 4.73 kB
frontend/dist/xml 2.98 kB
frontend/dist/yaml 4.6 kB

compressed-size-action

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 30, 2026

Prompt To Fix All With AI
This is a comment left during a code review.
Path: posthog/api/user.py
Line: 290-295

Comment:
**Tuple constant re-created on every loop iteration**

`_dict_notification_keys` is defined inside the `for key, value in notification_settings.items()` loop, so it's re-created as a fresh tuple object on every iteration. Move it outside the loop (or to module level alongside `NOTIFICATION_DEFAULTS`) to avoid the repeated allocation.

```suggestion
        _dict_notification_keys = (
            "project_weekly_digest_disabled",
            "error_tracking_weekly_digest_project_enabled",
            "web_analytics_weekly_digest_project_enabled",
        )
```

…should be hoisted above the `for` loop (or defined at module level). The body of the `if` block can then remain as-is.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: products/web_analytics/backend/weekly_digest.py
Line: 133-141

Comment:
**Result-processing happens outside the `try/except`, so malformed rows can crash the whole org's digest run**

The `try/except` block above only guards `runner.calculate()`. The list comprehension that accesses `row[1][0]` and `row[2][0]` runs after the guard ends. If any row returned by the runner has `None` (or another non-subscriptable value) for the visitors or pageviews column, a `TypeError` will propagate through `build_team_digest` and into the `for team in all_org_teams` loop in `build_and_send_digest_for_org_op`, halting digest delivery for the entire organisation.

The same pattern exists in `get_top_sources` (line 169). Consider either moving result processing inside the `try/except`, or using a defensive accessor:

```python
    return [
        {
            "host": "",
            "path": row[0] or "",
            "visitors": (row[1] or (0, 0))[0],
            "pageviews": (row[2] or (0, 0))[0],
        }
        for row in response.results
    ]
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: products/web_analytics/backend/weekly_digest.py
Line: 59

Comment:
**`previous or 0` masks `None` vs zero for session-based metrics**

For `visitors`, `pageviews`, and `sessions`, `item.previous or 0` silently converts `None` (no previous data) to `0` before it reaches `compute_week_over_week_change`. The function treats both `None` and `0` identically (returns `None`), so the final email output is identical — but the stored `previous` value in the result dict is `0` rather than `None`, making it impossible for any future consumer to distinguish "no previous period data" from "zero traffic last week".

The `bounce_rate` block (line 69) correctly passes `bounce_item.previous` (i.e., `None`) directly. Consider applying the same pattern to the loop metrics for consistency:

```python
            current = item.value or 0
            previous = item.previous  # keep None to distinguish "no data" from zero
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Add Web Analytics Digest Email Job" | Re-trigger Greptile

Comment thread posthog/api/user.py Outdated
Comment thread products/web_analytics/backend/weekly_digest.py Outdated
Comment thread products/web_analytics/backend/weekly_digest.py Outdated
@jordanm-posthog jordanm-posthog added the update-snapshots Enable auto commit snapshots for Storybook and Playwright label Mar 31, 2026
Comment thread products/web_analytics/dags/weekly_digest.py Outdated
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Mar 31, 2026

Visual regression: Storybook UI snapshots updated

Changes: 2 snapshots (2 modified, 0 added, 0 deleted)

What this means:

  • Snapshots have been automatically updated to match current rendering
  • Next CI run will switch to CHECK mode to verify stability
  • If snapshots change again, CHECK mode will fail (indicates flapping)

Next steps:

  • Review the changes to ensure they're intentional
  • Approve if changes match your expectations
  • If unexpected, investigate component rendering

Review snapshot changes →

@jordanm-posthog jordanm-posthog requested a review from a team April 1, 2026 15:15
Copy link
Copy Markdown
Member

@lricoy lricoy left a comment

Choose a reason for hiding this comment

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

Sorry for the likely block but I think the bit for:

Fan out one Dagster op per qualifying org

Makes this more suitable for temporal or celery like the health checks because of the amount of iterations. You could, however, use a dagster asset/materialization to come up to the list to send if you want.

Especially after: https://posthog.slack.com/archives/C092D6DE1L2/p1775063076802709

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, please remove the stale label – otherwise this will be closed in another week. If you want to permanently keep it open, use the waiting label.

@github-actions github-actions Bot added the stale label Apr 9, 2026
Comment thread products/web_analytics/backend/test/test_weekly_digest.py Fixed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 10, 2026

🎭 Playwright report · View test results →

⚠️ 2 flaky tests:

  • Can delete a person (chromium)
  • Materialize view pane (chromium)

These issues are not necessarily caused by your changes.
Annoyed by this comment? Help fix flakies and failures and it'll disappear!

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Apr 10, 2026

Query snapshots: Backend query snapshots updated

Changes: 1 snapshots (1 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Apr 10, 2026

⏭️ Skipped snapshot commit because branch advanced to c6ca1ad while workflow was testing 7ae357a.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Apr 10, 2026

⏭️ Skipped snapshot commit because branch advanced to a13e941 while workflow was testing c6ca1ad.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Apr 10, 2026

⏭️ Skipped snapshot commit because branch advanced to ac0336a while workflow was testing a13e941.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Apr 10, 2026

Visual regression: Storybook UI snapshots updated

Changes: 2 snapshots (2 modified, 0 added, 0 deleted)

What this means:

  • Snapshots have been automatically updated to match current rendering
  • Next CI run will switch to CHECK mode to verify stability
  • If snapshots change again, CHECK mode will fail (indicates flapping)

Next steps:

  • Review the changes to ensure they're intentional
  • Approve if changes match your expectations
  • If unexpected, investigate component rendering

Review snapshot changes →

@jordanm-posthog jordanm-posthog requested a review from lricoy April 13, 2026 18:02
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Apr 13, 2026

Query snapshots: Backend query snapshots updated

Changes: 1 snapshots (1 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

Copy link
Copy Markdown
Member

@lricoy lricoy left a comment

Choose a reason for hiding this comment

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

🚢 it!

Just some nit comments, completely optional

Comment on lines +201 to +204
@activity.defn(name="wa-digest-send-test")
async def send_test_wa_digest(input: SendTestDigestInput) -> None:
"""Send a single test digest email for one team, bypassing feature flags."""
await database_sync_to_async(_send_test_digest, thread_sensitive=False)(input.team_id, input.email, input.force)
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.

🫶

Comment thread products/web_analytics/backend/weekly_digest.py
Comment thread products/web_analytics/backend/weekly_digest.py
Comment on lines +237 to +249
def auto_select_project_for_user(user, team_traffic_data: dict[int, dict]) -> bool:
"""For first-time users who have no WA digest project settings, auto-select the project with the most visitors.

Returns True if settings were updated (caller should refresh_from_db).
"""
from posthog.tasks.email_utils import auto_select_digest_project

return auto_select_digest_project(
user=user,
team_data=team_traffic_data,
setting_key="web_analytics_weekly_digest_project_enabled",
sort_key=lambda d: d.get("visitors", {}).get("current", 0),
)
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.

Nice! I've also recently included a toggle to check if we should default to include the host on the breakdowns as well instead of just the paths. I think for "All domains" and for this digest, it might be useful

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.

Oh nice, yeah I can fast follow with that!

@jordanm-posthog jordanm-posthog merged commit 916fdd9 into master Apr 13, 2026
242 checks passed
@jordanm-posthog jordanm-posthog deleted the jordanm-posthog/addWADigest branch April 13, 2026 20:50
@inkeep
Copy link
Copy Markdown
Contributor

inkeep Bot commented Apr 13, 2026

No documentation PR created - This feature is gated behind the web-analytics-weekly-digest feature flag (at both org and user level), so it's not publicly available yet.

Once the feature flag is removed and the feature is generally available, documentation will be needed to cover:

  • The weekly digest email and what metrics it includes (visitors, pageviews, sessions, bounce rate, session duration, top pages, top sources, goals)
  • How to enable/disable the digest in user notification settings (/settings/user-notifications)
  • Per-project notification preferences

Feel free to tag me again when the feature is ready for public release! 🚀

@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented Apr 13, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-04-13 21:25 UTC Run
prod-us ✅ Deployed 2026-04-13 23:58 UTC Run
prod-eu ✅ Deployed 2026-04-14 00:25 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale update-snapshots Enable auto commit snapshots for Storybook and Playwright

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants