內容簡介
想知道一篇文章實際被顯示在屏幕上的頻率有多高嗎?
這個外掛程式含有一個JavaScript,當文章標題在視窗的可見區域顯示時,無論是當頁面加載時還是當視窗滾動或調整大小時都會觸發。當文章在頁面上但停留在視覺區域之外時則不會觸發。
有兩個獨立的計數器。‘顯示’ 計數器會計算所有文章的實例,不論是在概述頁面、搜索頁面還是它自己的頁面上。而 ‘查看’ 計數器僅計算它自己的頁面上的文章。請注意,‘查看’ 這也被計算為 ‘顯示’。
這兩個計數器是由JavaScript觸發的。這意味著搜索引擎機器人不會觸發計數器。同樣地,如果用戶禁用了JavaScript,計數器也將不會觸發。
默認情況下,計數器的值將顯示在每篇文章的頁面上方。該外掛程式有幾個可以用於模板文件中以更好地控制的功能。
致謝
我們為荷蘭海牙的當地新聞和博客網站http://denhaagdirect.nl創建了這個外掛程式。感謝Michael和Jeroen讓我們分享這個外掛程式。
外掛標籤
開發者團隊
原文外掛簡介
Want to know how often a post is actually displayed on the actual screen?
This plugin has a javascript that is triggered when the title of a post is displayed in the visible area of the window, either when the page is loaded or when the window is scrolled or resized. It will not be triggered when the post is on the page but stays outside the visual area.
There are two independent counters. The ‘displayed’ counter counts all instances of the post, whether it is in overview pages, search pages or on its own page. The ‘viewed’ counter only counts the post on its own page. Note that ‘viewed’ this also is counted as ‘displayed’.
The ratio between the two values can be used as a metric for the attractiveness of the article title, the excerpt and/or featured images that are displayed in overviews.
Both counters are triggered by javascript. This means that search bots will not trigger the counter. Also the rare cases a user has javascript disabled the counter will not be triggered.
The counter values will by default be displayed above each post on its own page. The plugin has several functions that can be used inside template files for more control.
Acknowledgements
We created this plugin for http://denhaagdirect.nl, a local news and blog website in The Hague, Netherlands. . Thanks Michael and Jeroen for letting us share this plugin.
