How can I hide a link's origin from the linked-to site's analytics?

我的未来我决定 提交于 2019-12-12 02:14:22

问题


I've been googling for a while now, but wasn't able to find an answer to this.

What I want to accomplish is the following:

Let's say I have a website that I hide from search engines etc. and that is pretty much only accessible through the direct URL. I want only people whom I send the link to see the site.

On my site I talk about my favourite pizza and link to Joe's Pizza Store.

When one of my visitor clicks the link, Joe's Pizza Store will see my URL as a referrer in their analytics.

Is there anything I can do to my link tags (or otherwise) to obscure the origin?


回答1:


use rel="noreferrer"

something like this:

<a href="signin.php" rel="noreferrer">sign in</a>

The noreferrer keyword may be used with a and area elements. This keyword does not create a hyperlink, but annotates any other hyperlinks created by the element (the implied hyperlink, if no other keywords create one).

It indicates that no referrer information is to be leaked when following the link.

If a user agent follows a link defined by an a or area element that has the noreferrer keyword, the user agent must not include a Referer (sic) HTTP header (or equivalent for other protocols) in the request.

This keyword also causes the opener attribute to remain null if the hyperlink creates a new browsing context.

More info here



来源:https://stackoverflow.com/questions/38223068/how-can-i-hide-a-links-origin-from-the-linked-to-sites-analytics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!