无法让我的引荐来源代码真正导致 Google Analytics(分析)显示引荐
下面的代码是否足以将引用标记添加到 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
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不熟悉 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.
至少不要在没有等待合理时间的情况下依赖 Google Analytics 或此类工具来得出结论,因为统计数据不是实时的,而是合理的最新数据。
使用记录器、嗅探器或检查服务器日志来查看服务器的内容。
我是如何正确编写这个答案的:apache 服务器访问日志显示:
如您所见, 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:
As you can see, the referrer is correctly reported to the server.