无法让我的引荐来源代码真正导致 Google Analytics(分析)显示引荐

发布于 2024-10-25 03:36:27 字数 516 浏览 1 评论 0原文

下面的代码是否足以将引用标记添加到 HTML 请求?

我已经在我的个人网站上测试了这段代码,虽然我可以看到来自其他网站的推荐出现在 Google Analytics 的报告中,但名为 mysite 的推荐人不会出现,即使我等待一两天以确保 GA 已更新其报告。

IDhttp1.Create(Self);
IDhttp1.HandleRedirects := TRUE;
IDhttp1.Request.Referer := 'http://www.mysite.com';
IDhttp1.Get(URL); // ignore result. Just done to hit the site with the referer string

使用 ShellExecute 时将“referer”添加到标头的后续操作。

Would the code below be all that is necessary to add a referer tag to an HTML request?

I have tested this code on my personal site and although I can see referrals from other sites appear in Google Analytics' reports, a referer named mysite doesn't appear, even if I wait a day or two to make sure GA has updated its reports.

IDhttp1.Create(Self);
IDhttp1.HandleRedirects := TRUE;
IDhttp1.Request.Referer := 'http://www.mysite.com';
IDhttp1.Get(URL); // ignore result. Just done to hit the site with the referer string

Follow-up to Add "referer" to header when using ShellExecute.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

濫情▎り 2024-11-01 03:36:27

我不熟悉 Delphi,但看起来您正在尝试以编程方式请求页面。但是,这可能不会执行 Google Analytics JavaScript 代码来注册综合浏览量。

I'm not familiar with Delphi but it looks like you're trying to request a page programmatically. However, this probably won't execute the Google Analytics JavaScript code to register the pageview.

江南月 2024-11-01 03:36:27

至少不要在没有等待合理时间的情况下依赖 Google Analytics 或此类工具来得出结论,因为统计数据不是实时的,而是合理的最新数据。

使用记录器、嗅探器或检查服务器日志来查看服务器的内容。

我是如何正确编写这个答案的:apache 服务器访问日志显示:

Apache log

如您所见, Referrer 已正确报告给服务器。

Do not rely on Google Analytics or this kind of tools to make conclusions, at least, without waiting a reasonable amount of time, as statistics are not real-time, but reasonable up to date.

Use a logger, a sniffer or check your server logs to see what's going to the server.

Is what I did to properly write this answer: the apache server access log show this:

Apache log

As you can see, the referrer is correctly reported to the server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文