Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20451
    scuba_stan
    Participant

    Hello DFactory,

    I have a news aggregation site. I find and post news articles from lots of different sources. I post the headline/title on my page, and when a user clicks on the headline it redirects them to the original article. Is their a way I can count the click through?

    Sincerely,
    Stan

    #20574
    Bartosz
    Keymaster

    Hi,
    It depends how your site is built, but if each aggregated article has a separate post created on your site (with headline/title as you say) i think it’s possible.

    There’s no out of the box solution for this, but is doable imo.

    For example in jquery/javascript I would try to catch the click event on the title link like this maybe: https://stackoverflow.com/questions/6825955/perform-a-jquery-event-before-opening-up-a-link
    Then would make an ajax request to custom action that fires pvc_view_post( $post_id ) function or PVC builtin ajax action (look at it’s done in frontend.js file and counter.php)
    After the ajax is done redirect the user (in jquery) to a title link href.

    That’s at least a brief idea.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.