• Resolved seyitacar

    (@seyitacar)


    Hi Hector,

    I am organizing a contest to encourage people to write on my website, I will give gifts to those who write the most read articles in the month.

    However, the number of reads increases with each page refresh and this causes unfair competition. Some authors are pushing their articles up the rankings by repeatedly refreshing the page, isn’t there a way to get around that?

    Check this:
    https://bazendefter.com/blog-siralamasi/

    The first post was read about 900 times, but when I checked it from Google Analytics, the different session read count was only 215.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    WordPress Popular Posts doesn’t keep track of IP addresses nor creates cookies when someone visits a post/page so no, there’s currently no way to prevent that from happening.

    Off the top of my head -or at least this is how I would probably tackle this- a possible solution would be hooking into wpp_trackable_post_types, add the whole session/IP address logic in your callback function to check whether someone has already seen the current post/page, and then return either a non-existent post type (eg. return ['foobar'];) so the function WPP uses to check if the current page is a single page (see here) returns false, effectively preventing said page view from being counted, or return the trackable post types array as-is so WPP can count this visit normally.

    If all of the above sounds a bit too technical (or if you don’t have the time to implement this yourself), you may want to consider hiring a developer so they can help you out with this.

    Feel free to ask any questions you may have, ok?

    Thread Starter seyitacar

    (@seyitacar)

    Well, I’m sure you wrote a pretty revealing answer, but I think it’s a bit too technical for me.

    I could not understand exactly what I had to do.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Then my advice is -as I already suggested above- consider having a developer look into this for you. The workaround described above is technical and does require some coding skills to get it done.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Marking as resolved due to inactivity.

    OP if you still have questions about this please feel free to leave a comment below.

    I too think this functionality would an asset – however, I also understand that it would take a great deal of technical expertise to implement.

    Plugin Author Hector Cabrera

    (@hcabrera)

    I agree it would be useful but as you pointed out it’s not that simple to implement if you want to do it well. And you’d have to deal with GDRP too since you’re technically collecting user’s personal data, you want to somehow make sure visitors are made aware of that before you collect said data to avoid legal issues which also makes this technically more challenging. (Or at least that’s my understanding, I may be wrong.)

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Session or IP Based View Counter’ is closed to new replies.