ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Page Views Not Working

November 06, 2010 2:54am

Subscribe [5]
  • #1 / Nov 06, 2010 2:54am

    KenKodz

    25 posts

    I have read the User Guide for views tracking and had it working. Now for some reason it no longer works. I don’t think I did anything to to break it but I am asking for help to figure it out.

    Here is the code I am using:

    {exp:channel:entries channel="training" limit="1" dynamic="yes" status="NOT closed" track_views="one"}

    My understanding is that since I am limiting the output to just a single entry, the views tracking would work.

    Please help me understand the problem.

  • #2 / Nov 07, 2010 11:12am

    Greg Salt

    3988 posts

    Hi Ken,

    Please confirm the version and build of EE that you are using. Are you outputting the {view_count_one} tag on that template and it is not updating? These variables will only update on a single entry page and not just any template that is displaying only one entry. Single entry pages are ones that show only a single entry, specified by the ID number or URL Title in the URL. Is that the case on this site?

    Cheers

    Greg

  • #3 / Nov 07, 2010 12:30pm

    KenKodz

    25 posts

    Hi Greg,

    Please confirm the version and build of EE that you are using.

    ExpressionEngine v2.1.1 - Build:  20101020

    Are you outputting the {view_count_one} tag on that template and it is not updating?

    Correct, and it is also not updating the database.

    These variables will only update on a single entry page and not just any template that is displaying only one entry. Single entry pages are ones that show only a single entry, specified by the ID number or URL Title in the URL. Is that the case on this site?

    Yes, this is the case. I am using the URL title in the URL.

    Also, while we are on the subject, I don’t understand why this is a restriction. In my opinion a view is a view and if told to track the view in the entries tag it should count it. But that isn’t the purpose of the thread so I digress.

    Thanks, as always, for the help.

  • #4 / Nov 07, 2010 12:50pm

    KenKodz

    25 posts

    UPDATE:

    If I install the Pages Module and input the path and template into the entry, the view counting will work. This is far from an ideal fix however.

  • #5 / Nov 08, 2010 9:22am

    Sue Crocker

    26054 posts

    Hi, Ken-at-Trinity - I can’t replicate the problem you’re having with view counting not working on a single entry page. Are you displaying the entry with http://example.com/index.php/templategroup/template/name-of-entry or something similar?

  • #6 / Nov 08, 2010 1:03pm

    KenKodz

    25 posts

  • #7 / Nov 09, 2010 4:28am

    John Henry Donovan

    12339 posts

    Ken-at-Trinity,

    that might be where your issue lies, as in you are not using a typical single entry URL.

    It should be in the format like Sues. You may have to rethink your structure here.

  • #8 / Nov 09, 2010 9:39am

    KenKodz

    25 posts

    I am using a typical single entry page that uses categories and the “category” keyword to call a category via it’s name vice it’s id. This is using built in functionality. I’m confused.

  • #9 / Nov 09, 2010 11:58am

    KenKodz

    25 posts

    Are you saying that if you use categories that you can’t use view tracking? I guess I need to go through the actual code to see how you guys perform view tracking. The limitations of this method of view tracking absolutely boggles my mind. Especially since this platform is so extensible. I love using EE2 but this feature is something that every CMS should have available and should be easily accessible.

    I am really not trying to rant - I am merely flabergasted about finding such a huge limitation. I preach EE2 and it’s abilities and I suppose that if there are no planned changes to this function then the best I can do is take the time to build some sort of plugin to do it. Unfortunately that means that I have to delay some functionality for my client which is never good for business.

  • #10 / Nov 09, 2010 12:30pm

    Ingmar

    29245 posts

    Are you saying that if you use categories that you can’t use view tracking?

    In a way, yes. View tracking counts how often a particular entry is viewed: how do you do that if you’re showing more than one entry at a time? Increase the counter for all articles?

    The built-in view tracking will only work with single-entry type pages. If you’re showing a whole category, or an index of the last 10 articles or whatever, that won’t affect tracking.

  • #11 / Nov 09, 2010 1:16pm

    KenKodz

    25 posts

    Yes ... if I put the tag in to count the views in a template then it should count the views. If I don’t want to count the views the I will leave out the tag.

  • #12 / Nov 09, 2010 1:38pm

    Ingmar

    29245 posts

    Unfortunately that’s not how it currently works. Perhaps you might want to make a Feature Request?

  • #13 / Nov 10, 2010 5:06pm

    KenKodz

    25 posts

    Disappointed, but I understand. Please close this thread.

  • #14 / Nov 10, 2010 9:31pm

    KenKodz

    25 posts

    Hey guys,

    It seems that all I needed to do to get the functionality that I needed was to use the information found here:

    http://ellislab.com/expressionengine/user-guide/general/hidden_configuration_variables.html#relaxed_track_views

    I set relaxed_track_views to yes and magically it all works.

    Thanks for all the dialog and help. See you on the next question.

  • #15 / Nov 11, 2010 3:42pm

    Ingmar

    29245 posts

    Very glad to see you found a solution 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases