最近我開始使用yandex的分析工具,它爲您提供了關於訪問者的詳細信息,甚至還記錄了每個訪問者訪問您網站的視頻。 。該工具的鏈接是:metrica.yandex.com這是完全免費在nginx中爲yandex刪除「X-Frame-Options」標題
反正Yandex的工具提供一個選項叫做地圖,顯示在您的網站在訪問者點擊最多的地方,這樣,當我試圖用它
我收到了錯誤消息:
Not possible to replay visit on the given page. Possible reasons:
Counter code not configured
Displaying this page in a frame is forbidden
我很確定它的配置碼很好配置,我把它放在我網站上的正確位置,所以我訪問了幫助頁面鏈接:yandex.com/support/metrica/behavior/click-map.html
,看看有什麼問題,所以我發現,
If your site is protected from being shown in an iframe (the X-Frame-Options header is used in the server settings), the collected data won't be available for viewing. To view the site's session data, you must change the server settings and add an exception for the webvisor.com domain and subdomains, as well as for your site's domain. Use the regular expression
和他們給誰使用的用戶nginx的需要將其添加在配置文件中做出的地圖正常工作
這樣一個代碼,我添加它,這是我的配置文件後添加幾行
.....
server_name _;
location/{
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
set $frame_options '';
if ($http_referer !~ '^https?:\/\/([^\/]+\.)?(www.google\.com|webvisor\.com)\/'){
set $frame_options 'SAMEORIGIN';
}
add_header X-Frame-Options $frame_options;
}
.....
我與www.google.com
改變了我的域名,但它仍然顯示我的錯誤,我不知道爲什麼,但也許我錯過了一些步驟......請你們建議我可能解決方案我需要很多這個選項才能知道我的廣告位置
完成後nginx的配置-T' –