英文:
How do I know from which site they entered our site? Asp.net Core
问题
我有一个网站,其链接被放置在各种网站上进行广告。如何知道进入我们网站的用户是来自我在Asp.net Core上做广告的其中一个网站呢?
我知道UrlReferrer可以帮助解决我的问题,但我不知道如何使用!
英文:
I have a website whose link is placed on various websites for advertisement. How can I know that the user who entered our site came from one of the websites that I advertised on in Asp.net Core ?
I know UrlReferrer can help my problem , But I don't know how?!
答案1
得分: 1
你在其他网站上放置了项目链接,实际上等同于调用你的Api接口。你可以通过接收Request
来获取对应的网站。
例如:
public string Test()
{
Uri uriReferer = Request.GetTypedHeaders().Referer;
return "success";
}
当从另一个网站请求Test()
操作时,我可以知道是哪个网站发起了该请求。
英文:
You put the project link in other websites, which is actually equivalent to calling your Api interface. You can obtain the corresponding website by receiving the Request
.
For example:
public string Test()
{
Uri uriReferer = Request.GetTypedHeaders().Referer;
return "success";
}
When requesting the Test()
action from another website, I can know which website initiated the request:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论