Skip to content

fix: separate WebApp analytics from console page tracking - #41251

Merged
iamjoel merged 5 commits into
mainfrom
feat/agents-ampltitud
Aug 26, 2026
Merged

fix: separate WebApp analytics from console page tracking#41251
iamjoel merged 5 commits into
mainfrom
feat/agents-ampltitud

Conversation

@iamjoel

@iamjoel iamjoel commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Route analytics by Next.js layout group so /agents captures UTM registration and app-creation attribution without conflicting with published WebApp routes.
  • Add a consent-gated WebApp Amplitude instance that disables automatic tracking, page views, remote configuration, and session replay while preserving explicit webapp_run events.
  • Keep Google Analytics exclusive to console routes and add regression coverage for analytics boundaries, consent changes, and WebApp event entry points.

Fixes DIFY-2948

Checklist

  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.

@github-actions github-actions Bot added the web This relates to changes on the web. label Aug 25, 2026
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.52632% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.67%. Comparing base (1299d99) to head (8fc161d).

Files with missing lines Patch % Lines
...eb/app/components/base/amplitude/web-app-client.ts 71.79% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #41251      +/-   ##
==========================================
- Coverage   86.73%   86.67%   -0.06%     
==========================================
  Files        5429     5275     -154     
  Lines      307710   302725    -4985     
  Branches    61800    60616    -1184     
==========================================
- Hits       266886   262390    -4496     
+ Misses      35567    35106     -461     
+ Partials     5257     5229      -28     
Flag Coverage Δ
cli ?
dify-ui 93.75% <ø> (ø)
web 86.78% <85.52%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread web/app/components/base/amplitude/web-app-client.ts
@iamjoel
iamjoel marked this pull request as ready for review August 26, 2026 02:38
@iamjoel
iamjoel requested review from hyoban and zxhlyh as code owners August 26, 2026 02:38
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 26, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 26, 2026
@iamjoel
iamjoel added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit dfe396f Aug 26, 2026
42 of 43 checks passed
@iamjoel
iamjoel deleted the feat/agents-ampltitud branch August 26, 2026 03:11
lyzno1 pushed a commit that referenced this pull request Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants