Commit 40fb779
feat: Add analytics tracking to VShare WebView (#161)
* feat: add analytics tracking to VShare WebView
Add custom User-Agent and source parameter to track V2er app traffic
to VShare page for analytics purposes.
Changes:
- Set custom User-Agent: "Mozilla/5.0... V2er-Android/{version}"
- Add source parameter to URL: "?theme={theme}&source=v2er-android"
- Add getAppVersion() method to retrieve app version for User-Agent
This enables VShare page to:
1. Identify traffic from V2er Android app via User-Agent header
2. Track app version distribution
3. Filter analytics by source parameter
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: address Copilot review feedback for VShare analytics
Address code review feedback from Copilot:
1. Use Uri.Builder for safer URL construction
- Replace manual string concatenation with Uri.Builder
- Properly encode query parameters
- Handle existing parameters correctly
2. Replace PackageManager with BuildConfig.VERSION_NAME
- Use BuildConfig.VERSION_NAME directly (no try/catch needed)
- Avoid deprecated PackageManager.getPackageInfo() call
- Simpler and more reliable implementation
Changes:
- VshareWebActivity.java:106-114: Use Uri.Builder for URL construction
- VshareWebActivity.java:286-288: Simplify getAppVersion() with BuildConfig
- Add BuildConfig import
Note: Test coverage suggestions noted but deferred for future enhancement.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent eba89d4 commit 40fb779
File tree
1 file changed
+22
-7
lines changed1 file changed
+22
-7
lines changedLines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
146 | 154 | | |
147 | 155 | | |
148 | 156 | | |
| |||
273 | 281 | | |
274 | 282 | | |
275 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
276 | 291 | | |
277 | 292 | | |
278 | 293 | | |
| |||
0 commit comments