Lasting Impressions for EECMS v2
Compatibility
Compatible with EE versions | 2.5.2+ |
Lasting Impressions Version | 3.0.2 |
Overview
This ExpressionEngine module will record the entries viewed by each visitor to your site. You can then re-display each visitor's entries to them using all the same functionality as the standard ExpressionEngine channel:entries tag pair.
This module was originally designed for ecommerce sites to display a "recently viewed products" list to each customer, however it can be used anywhere you need to record and "playback" entries seen by each visitor to your site.
You can track entries from any or all channels and then specify which channel you are interested in when playing them back.
The entries are stored in a cookie for each visitor to your site.
With Version 3 you can now keep logs of the number of views of each tracked entry and delve into your stats and view reports (see reports documentation) on tracked Channel Entries.
Usage
The module consists of three template tags:
{exp:lasting_impressions_pro:register}
This is used to register the id of each entry you want to record.
{exp:lasting_impressions_pro:entries} {/exp:lasting_impressions_pro:entries}
This tag pair which is used to re-play the channel entries of each of the ids previously recorded by the register tag.
{exp:lasting_impressions_pro:form}{/exp:lasting_impressions_pro:form}
This tag is used when you want your visitors to be able to remove items from their "recently viewed" list. See Allowing a visitor to remove items from the list of recently viewed entries.
Installation
- Unzip the Lasting Impressions Pro zip archive
- Upload the folder /ExpressionEngine/system/third_party/lasting_impressions_pro to your site's ExpressionEngine system/third_party folder
- Upload the /themes/third_party/lasting_impressions_pro folder to your themes/third_party folder.
- Log in to the ExpressionEngine CP and navigate to Add-Ons -> Modules
- Locate Lasting Impressions Pro in the list and install it by selecting the "Install" link in the Action column. Make sure you install both the Extension and the Module.
Control Panel
Module Settings
Add-ons -> Modules -> Lasting Impressions Pro
Before you can enter or edit the settings you just make sure that the plug-in is enabled by selecting the "enable" radio button.
Maximum number of entries to record: specify the maximum number of entries which will be recorded for each visitor. Newer entries will push older ones off the list.
Number of days before cookie expires: the entries that a visitor has seen are stored in a cookie. That cookie will exist for the number of days specified here or until the visitor clears their cookies.
Extension Settings
Add-ons -> Extensions -> Lasting Impressions Pro -> settings
Lasting Impressions also has an ExpressionEngine Extension which is used to replace tags in the EE channel entries loop. One of it's functions is to format the date and time of the {lasting_impressions:last_view} variable. If you find that the date and time are incorrect then this may be due either to your server's time being wrong or a problem with EE's localisation function. You can control whether Lasting ImpressionsPro uses EE's localisation by navigating to Add Ons -> Extentions -> Lasting Impressions and switching localisation on or off.
Entries
N.B. As the Entries tag pair inherits from the Channel Entries tag pair you need to observe the same rules with regard to nesting. Do not nest the {exp:lasting_impressions_pro:entries} tag pair inside an {exp:channel_entries} tag pair (use an embed or another method if you need the Lasting impressions entries tag to be placed within an ExpressionEngine Channel Entries tag pair).
Add the following tag pair to a template to display the list of recently viewed items:
... your custom fields and markup go here ...
{/exp:lasting_impressions_pro:entries}
This tag pair is identical to the ExpressionEngine channel entries tag pair. The parameters are limited to those listed below however you can use any of the variables / custom fields that you would normally use in your channel entries loop.
Parameters
- channel
- display_order
- status
channel
[Required] You must specify which channel you require for your results. Without this you will get errors if you choose channel fields that are not global.
display_order
[Optional] Display the entries by the most recent first (as determined by their time stamp) or the order in which they were registered. Useful when the registered order isn't necessarily in date/time order when make_revisits_most_recent is set to "no". Setting this value to "recent" will ensure a list of entries displayed in the order they were last visited.
status
[Optional] Specify the ExpressionEngine channel status of the channel entries you wish to display The Default is "open". Multiple values are separated by a pipe character.
Variables
Choose any channel field name used by the entries. The returned entries work just like they do in the standard ExpressionEngine channel entries tag.
You can also use the Lasting Impressions Utility Tags view_count and last_view tags within this tag pair
Form
Enabling a visitor to remove items from the list of recently viewed entries
Lasting Impressions Pro gives you two methods to choose from which enable visitors to remove items from their list of recently viewed entries. You can wrap each item in a form, submit data and refresh to get the new list or you can use Ajax which will reload the data on the fly.
Posting a form to Remove Entries
Each entry will be wrapped in a form and a visitor will be able to click on a link or a button to remove entries. You can display each entry within this tag in exactly the same way as you would use an ExpressionEngine channel entries tag pair. All the fields are available to you along with the two additional fields described above.
... your custom fields and markup go here ...
{exp:lasting_impressions_pro:form}
Parameters
- channel
- display_order
- status
- submit_value
- use_html5
- use_ajax
- listings_template
- parent_tag_id
channel
[Required] You must specify which channel you require for your results. Without this you will get errors if you choose channel fields that are not global.
display_order
[Optional] Display the entries by the most recent first (as determined by their time stamp) or the order in which they were registered. Useful when the registered order isn't necessarily in date/time order when make_revisits_most_recent is set to "no". Setting this value to "recent" will ensure a list of entries displayed in the order they were last visited.
status
[Optional] Specify the ExpressionEngine channel status of the channel entries you wish to display The Default is "open". Multiple values are separated by a pipe character.
submit_value
[Optional] The tag pair will generate either a submit button or an anchor for you to use as the remove link. This is especially useful for the ajax option (below) as it will ensure that each button or link contains the correct css class used by the built in JavaScript. To ensure the tag pair inserts a button or link you use a {submit_button} or {submit_link} variable.
This parameter lets you specify what text should be displayed in the resulting markup. If you include either of the submit tags but omit this parameter then the default text "Remove ..." will be used. Of course you're free to use your own link or button.
use_html5
[Optional] If the tag pair is generating a submit button for you, should the resulting markup close the tag with a > (html5) or with a />
use_ajax
[Optional] You can submit the form using AJAX by setting this parameter to "yes". If you do this then you must include the supplied AJAX script by using the {exp:lasting_impressions:load_js} tag (see below) and you must also specify the listings_template and parent_tag_id paramters as well.
listings_template
[Required if use_ajax="yes"] This tells the ajax call which template to use for re-listing the entries once one of them has been removed. See Using Ajax for more information
parent_tag_id
[Optional] This tells the AJAX function which containing tag to use for displaying the revising listing. See Using Ajax for more information
Variables
Use any channel field name used by the entries. The returned entries work just like they do in the standard ExpressionEngine channel entries tag.
You can also use the Lasting Impressions Utility Tags view_count and last_view tags within this tag pair
The tag pair will also generate a submit button or link for you, which ensures the correct class parameter is used if you want to use the AJAX functionality. These variables are
which will generate an HTML submit button, and
which will generate an HTML anchor tag.
Both will include the css class remove-lasting-impressions which the AJAX JavaScript uses to attach its "click" event to.
Using Ajax
You can avoid refreshing the whole page, here's how.
Lasting Impressions Pro comes with some JavaScript that you are free to use. You must load the JavaScript using this tag anywhere on your page:
Parameters
load_jquery
Default: "true"
Lasting Impressions Pro comes with version 1.10.2 minimized version of JQuery. If you are already loading JQuery, set this parameter to false to avoid loading conflicting JQuery files however, if you do this then make sure you insert this tag AFTER you load JQuery.
When displaying the list of recently viewed items you will use the form tag (as mentioned earlier) making sure you include the three additional AJAX specific parameters - use_ajax, listings_template and parent_tag_id.
Your listings template should be simply the lasting_impressions:form tag (as specified above) which you use to list out all the recorded entries. If you include this in your main page as an {embed} within a containing element the AJAX call will re-load the template and insert it into that containing element each time an entry is removed.
You tell the AJAX where the containing element is by giving it an id and then entering that id into the parent_tag_id parameter
The listings_template tag must include the fully qualified path to the template as you would use in a standard ExpressionEngine {embed} tag like this:
The parent_tag_id contains the id of the containing element for the list of entries, like this (assuming your id is called li-template):
Here is an example ExpressionEngine template showing a main page and an embedded listing template. First, here's a snippet of markup from the main page:
{embed="shop/lasting_impressions_list"}
... and here's the contents of the embedded template shop/lasting_impressions_list:
{exp:lasting_impressions_pro:form channel="products"
status="open"
use_ajax="yes"
listing_template="shop/lasting_impressions_list"
parent_tag_id="lasting_impressions_ajax"
submit_value="Remove this entry ..."
use_html5="yes"
display_order="recent"}
{title}
... any of your custom channel fields ...
{submit_button}
Viewed {lasting_impressions_pro:view_count} times
Last viewed on {lasting_impressions_pro:last_view format="%D,%F %d, %Y - %g:%i:%s"}
{/exp:lasting_impressions_pro:form}
Reports
Version 3: View reports on tracked Channel Entries.
Navigate to the control panel and view the Lasting Impressions Pro Module page. You will see two buttons in the top right hand corner: select "Reports".
Once in the reports view you will see a report which shows each view of a tracked entry. The results are paginated with 25 results per page. You can view the statistics unadulterated or you can view the totals for each tracked entry by choosing the relevant report from the drop down list "Report Type:".
You can also export the data in CSV format by clicking on the "Export" button.
The "Purge All Data" button is there should you wish to delete all your data and start again with a clean slate. We would recommend that you do this AFTER having performed and export!
NB: On a busy website the report data could grow quite large so we highly recommend that you check back regularly and purge the data to ensure your database performance isn't affected.
Lasting Impressions is available to buy from ExpressionEngine