Skip to content

feat(web): unify create_app tracking and persist external attribution#35241

Merged
CodingOnStar merged 8 commits intomainfrom
feat/create-app
Apr 15, 2026
Merged

feat(web): unify create_app tracking and persist external attribution#35241
CodingOnStar merged 8 commits intomainfrom
feat/create-app

Conversation

@CodingOnStar
Copy link
Copy Markdown
Contributor

Summary

This PR refines app creation tracking and consolidates all create-related reporting into a single create_app event.

  • persist external attribution in sessionStorage to avoid losing it across registration/login and page switches
  • support preserving attribution when entering from Studio and creating later from Explore
  • remove consumed utm_source / utm_campaign / slug from the URL after attribution is captured
  • clear remembered attribution after successful create_app reporting to avoid duplicate external attribution

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

CodingOnStar added 6 commits April 13, 2026 14:12
…acking utilities

- Added functions to extract and clear external attribution parameters from the URL.
- Updated AppInitializer to utilize new attribution functions.
- Modified AmplitudeProvider to conditionally initialize based on the new isAmplitudeEnabled flag.
- Enhanced tests to verify the correct behavior of external attribution handling and URL parameter management.
@github-actions github-actions Bot added the web This relates to changes on the web. label Apr 15, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 96.62162% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.87%. Comparing base (5bc0f95) to head (a801499).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
web/utils/create-app-tracking.ts 96.58% 4 Missing ⚠️
web/app/components/apps/index.tsx 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #35241      +/-   ##
==========================================
+ Coverage   84.85%   84.87%   +0.02%     
==========================================
  Files        4360     4363       +3     
  Lines      196669   196854     +185     
  Branches    37276    37323      +47     
==========================================
+ Hits       166883   167088     +205     
+ Misses      26706    26686      -20     
  Partials     3080     3080              
Flag Coverage Δ
web 85.82% <96.62%> (+0.05%) ⬆️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CodingOnStar CodingOnStar marked this pull request as ready for review April 15, 2026 06:27
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. javascript Pull requests that update javascript code labels Apr 15, 2026
…ng utilities

- Introduced a new test suite for AppInitializer to validate external attribution handling.
- Updated create-app-tracking functions to handle cases when the window is unavailable.
- Added tests to ensure proper behavior when dealing with malformed UTM cookies and absence of attribution parameters.
Comment thread web/app/components/app-initializer.tsx Outdated
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 15, 2026
@CodingOnStar CodingOnStar added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit fb17339 Apr 15, 2026
33 checks passed
@CodingOnStar CodingOnStar deleted the feat/create-app branch April 15, 2026 09:08
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
asukaminato0721 pushed a commit to asukaminato0721/dify that referenced this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code 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