跳到内容

Loyalty.js

v2.0.2

eisenivan · 2014年10月28日 上架

Loyalty.js tracks visitor page views and helps you to serve content dynamically based on visitor loyalty.

正在使用
10 以下
评分
5.0 / 5
累计下载
1,470
最近更新
2015年1月27日
4 条评价需要 WordPress 3.0.1+已测试到 4.1.42

贡献者

What is Loyalty.js?

Loyalty js is a lightweight jQuery plugin that keeps track of how many times a user has come to your web property and allows you to craft a different experience based on that count. You can control the behavior by adding data-attribute tags to your DOM elements. Now, rather than having content rotate for every user at the same time, you will be able to “tell a story” that always starts at the beginning and progresses as a user becomes more engaged.

What does that mean?

Imagine you are a technology company with multiple project case studies on your site. As it stands now you can either…

1) Show your best case study first. This is great because people will see it first, but people that are returning to your site for the 3rd, 8th, 12th time still see it. Sure, you have calls to action that allow them to dig deeper and explore your content, but in essence, your landing page is no longer relevant to them. It is a wasted opportunity.

This leads people to…

2) Change up their content. They want to keep it “fresh”. The problem here is that a lot of people will come to your site that may never discover your favorite piece. Every user, regardless of how many times they have come see the same content. This feels like the equivilant of reading a story and forcing people that arrive late to join in the middle. What is “newest” is not always the most relevant way to introduce a first time visitor to your brand.

With loyalty.js you can dictate an experience that is based on how many times the user has visited your site, not an artificial timeline driven by “SEO Friendly Content Updates”.

WordPress Usage

This wordpress plugin comes complete with a shortcode that allows you to use loyalty.js tags in your content editor code. The shortcode is an enclosing tag.

[loyalty min=”3″ max=”4″]Your Content[/loyalty]

The plugin will honor min and max first. If you want the content to display at one specific view count, use ONLY the exact parameter.

[loyalty exact=”6″]This content will show on visit #6[/loyalty]

There is also a shortcode that allows you to print the number of views to the page. Simply add [loyalty_count] to your post content and Loyalty.js will render in a span tag with the css class of ‘loyaltyjs_count’ and the data-attribut ‘data-loyalty-count’. When it runs the plugin will fill in the integer value.

Advanced Implementation

If you would like to roll up your sleeves a little farther you can manually add data-attribute tage into your code. Please read the documentation on the GitHub page. https://github.com/eisenivan/loyalty

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums