Search keywords are lost for referrers whose search engine domain starts the URL
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #8230 来自 @RaphaelFakhri —— 已合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- javascript, node.js
调研方向
Read plugins/sources/api/api.js and trace how urlParser checks engine names and stores search parameters; compare this with the /o/keywords check described in the issue. Reproduce with one of the listed _store referrers and confirm its stored source retains the expected keyword parameter. A pull request is already open for this issue.
由索引模型根据 Issue 内容生成。
描述
For web apps, the sources plugin stores each referrer through urlParser in plugins/sources/api/api.js. For a search engine referrer, it keeps only the search query parameter. Engine-specific parameters (wd for Baidu, p for Yahoo, text for Yandex, u for facebook.com/l.php) are kept only if the referrer path contains the engine name, checked with path.indexOf(engine) > 0.
urlParser removes the protocol and www. before this check, so for many referrers the engine name is at index 0. The check fails and the parameter is dropped. The Search keywords view (/o/keywords) then has no keyword to show for these visits. /o/keywords checks the same thing with indexOf(...) !== -1, so the two checks disagree.
Steps to reproduce
Send a session for a web app with one of these _store values:
| Referrer | Stored source | Expected |
|---|---|---|
https://www.baidu.com/s?ie=utf-8&wd=countly |
baidu.com/s |
baidu.com/s?wd=countly |
https://yandex.ru/search/?lr=213&text=countly |
yandex.ru/search/ |
yandex.ru/search/?text=countly |
https://yahoo.com/search?fr=yfp&p=countly |
yahoo.com/search |
yahoo.com/search?p=countly |
https://www.facebook.com/l.php?u=https%3A%2F%2Fcount.ly |
facebook.com/l.php |
facebook.com/l.php?u=https%3A%2F%2Fcount.ly |
Referrers where the engine is a subdomain, such as https://search.yahoo.com/search?p=countly, are not affected.
Expected behavior
The keyword is kept, and it appears under Search keywords.
- 主要语言
- JavaScript
- 星标
- 5.9k
- 派生
- 985
- 平均合并
- 1 天 15 分钟
- 30 天内合并 PR
- 116
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 68/100
andromarces/agent-loops#1735 ·
维护者通常 1 天内回复
-
enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
BinaryBaconLabs/todo-app#32 ·
维护者通常 1 天内回复
-
Missing assertions to legacy Cafe Menu block tests可能已有人在做 @mariamanbar 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
freeCodeCamp/freeCodeCamp#71624 ·
维护者通常 1 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 70/100
JSPrismarine/JSPrismarine#2915 ·
维护者通常 1 天内回复
-
posthog
难度 2/5 1-3 小时 新手友好度 78/100
DobermanCore/Doberman-Core#791 ·
维护者通常 3 天内回复