How do I know from which site they entered our site? Asp.net Core

huangapple go评论70阅读模式
英文:

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:

How do I know from which site they entered our site? Asp.net Core

huangapple
  • 本文由 发表于 2023年5月29日 19:03:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76356779.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定