5

Does entry views tracking allow you for 4 instances all together or 4 instances per channel?

3 Answers 3

7

I know we talked about this on Twitter yesterday, but looking at the EE docs again it says:

"Up to four different instances of the view counter can be used (each on a different page), enabling you to track different aspects of an entry independently"

Which isn't immediately clear (at least in a pre-coffee state). So I did a quick test on my local site, implemented a view_count variable, and looked at the query to see where the data was getting stored. Turns out the view counts are stored in the exp_channel_titles table where there are 4 columns for tracking views.

So my answer is neither four instances total, or four instances per channel, but rather 4 instances per entry.

2

Be careful on using entry tracking on extremely busy web sites. exp_channel_titles is a generally heavy read table, add a lot of entry tracking on a busy site and you turn that into a heavy read/write table. Using InnoDB or similar replacement engines will help, but stock MyISAM table type and heavy read/write contention on that table will cause performance issues.

1

4 instances all together, but you can of course limit your results by channel(s):

{exp:channel:entries channel='news' orderby='view_count_one'}

or

{exp:channel:entries channel='news|portfolio' orderby='view_count_one'}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.