1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Link Hit Counter for Wordpress

Discussion in 'WordPress' started by ryanlie, Sep 15, 2012.

  1. #1
    Hi, i always create a manual link from wordpress (wp-admin --> Post), such as "download now" or "buy now" at the end of my posting. Are there any way to know how many visitor click/hit on that link?

    Thanks
    SEMrush
     
    ryanlie, Sep 15, 2012 IP
    SEMrush
  2. kulwantnagi2003

    kulwantnagi2003 Active Member

    Messages:
    191
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    90
  3. ryanlie

    ryanlie Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Actually the link is to go to other page on our website or on other website. Not for directly download a file. I try download-monitor and it's nice for directly download a file. But not found how to create a link to other page. I also try wp-downloadcounter, but i got nothing, don't know how to use it. Please help.
     
    ryanlie, Sep 16, 2012 IP
  4. gombile13

    gombile13 Active Member

    Messages:
    136
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    63
    #4
    I use GoCodes, ___http://www.shoutmeloud.com/hide-your-affiliate-links-with-gocodes-wordpress-plugin.html
    and enable hit counter for every link
     
    gombile13, Sep 16, 2012 IP
  5. ryanlie

    ryanlie Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This one is nice... Thank you. Do you know how it track the hits? I try to click more than one times, but it always track it as one hits.
     
    ryanlie, Sep 17, 2012 IP
  6. ryanlie

    ryanlie Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I found a hit counter for wordpress post without plugin. It will add one column on wordpress dashboard to show views (hit). Just add the code on single.php and functions.php.

    Add this to function.php:
    if ( ! function_exists( 'getPostViews' ) ) :

    function getPostViews($postID){
    $count_key = 'post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count==''){
    delete_post_meta($postID, $count_key);
    add_post_meta($postID, $count_key, '0');
    return "0 View";
    }
    return $count.' Views';
    }
    endif;


    if ( ! function_exists( 'setPostViews' ) ) :

    function setPostViews($postID) {
    $count_key = 'post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count==''){
    $count = 0;
    delete_post_meta($postID, $count_key);
    add_post_meta($postID, $count_key, '0');
    }else{
    $count++;
    update_post_meta($postID, $count_key, $count);
    }
    }
    endif;

    //Function that Adds a 'Views' Column to your Posts tab in WordPress Dashboard.
    function post_column_views($newcolumn){
    //Retrieves the translated string, if translation exists, and assign it to the 'default' array.
    $newcolumn['post_views'] = __('Views');
    return $newcolumn;
    }

    //Function that Populates the 'Views' Column with the number of views count.
    function post_custom_column_views($column_name, $id){

    if($column_name === 'post_views'){
    // Display the Post View Count of the current post.
    // get_the_ID() - Returns the numeric ID of the current post.
    echo getPostViews(get_the_ID());
    }
    }
    //Hooks a function to a specific filter action.
    //applied to the list of columns to print on the manage posts screen.
    add_filter('manage_posts_columns', 'post_column_views');

    //Hooks a function to a specific action.
    //allows you to add custom columns to the list post/custom post type pages.
    //'10' default: specify the function's priority.
    //and '2' is the number of the functions' arguments.
    add_action('manage_posts_custom_column', 'post_custom_column_views',10,2);
    ?>

    Add this to single.php when the loop starts:
    <?php setPostViews(get_the_ID()); ?>


    For more detail:
    http://bacsoftwareconsulting.com/bl...st-views-count-in-wordpress-without-a-plugin/
    http://www.be-studios.com/blog/2011...y-most-popular-viewed-posts-without-a-plugin/

    Note : Don't forget to backup before try it.:D
     
    ryanlie, Sep 24, 2012 IP
  7. ekoolz

    ekoolz Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    simply, goto Google analytics, create a GOAL set up for the link.
     
    ekoolz, Sep 25, 2012 IP