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