• Plugin Author Ajay

    (@ajay)


    All,

    In case you’re noticing that the plugin isn’t tracking all visits, you could try to add this piece of code to your themes functions.php file at the very bottom. This code attempts to restore the original tracker that was used in previous versions of Top 10.

    If your theme’s functions.php file has the closing php tags i.e. ?> then add this just before the closing tag.

    function filter_tptn_add_counter_script_url( $home_url ) {
    global $tptn_url;
    return $tptn_url . '/includes/top-10-addcount.js.php';
    }
    add_filter( 'tptn_add_counter_script_url', 'filter_tptn_add_counter_script_url' );

    If you’re running this piece of code, I’d appreciate a bit of feedback on the quality of tracking.

    https://www.ads-software.com/plugins/top-10/

Viewing 15 replies - 16 through 30 (of 32 total)
  • Plugin Author Ajay

    (@ajay)

    As of now, no. It’s one of the grand features that will find their way into another addon. It’s going to be a bit of work to get that to function.

    Alright, thanks very much!

    I really like this plugin and I’m trying to get it to work but it doesn’t track anything. When I check the source of the page this is all I ever get, 1 visit today

    <script type=”text/javascript”>jQuery.ajax({url: “https://www.thegiftsguy.com/wp-content/plugins/top-10/includes/top-10-addcount.js.php&#8221;, data: {top_ten_id: 1016, top_ten_blog_id: 1, activate_counter: 1, top10_rnd: (new Date()).getTime() + “-” + Math.floor(Math.random()*100000)}});</script><div class=”tptn_counter” id=”tptn_counter_1016″>(Visited 1 times, 1 visits today)</div>

    I have tried disabling every plugin I use that caches files or compresses javascript and I’ve tried the functions.php fix above but it doesn’t track. I also checked the database.

    Somehow I got two pages to track as 1 visit but I can’t get anything more. Can you help?
    https://www.thegiftsguy.com
    Thanks

    Plugin Author Ajay

    (@ajay)

    I assume you’re using the filter function at the very top of this post? If you delete this, does it track?

    I tried it at first and it wouldn’t track so I added the code to the functions.php file and it still doesn’t track. I know I have more pages that have at least one view ??
    I even tried disabling everything I could find that did compression or cache.
    You can see the source on this page here
    All it ever shows is (Visited 1 times, 1 visits today)

    Great job on the plugin by the way.

    Plugin Author Ajay

    (@ajay)

    Do you have a plugin that forces JQuery and other scripts to load in the footer?

    Can you try turning the Cache fix off?

    I have this https://www.ads-software.com/plugins/insert-headers-and-footers/
    and this https://www.ads-software.com/plugins/async-js-and-css/ any maybe one more.
    I disabled those and turned off the cache fix. One of those actions fixed it and now it tracks but I’m not sure which one.

    Thanks

    Plugin Author Ajay

    (@ajay)

    Can you try activating one of the plugins above and see if it works and then try the other.

    You might be able to isolate which one has the issue.

    OK i found the problem. i had the same thing.

    your single post has to have <?php the_content(); ?> to get the tracking going.

    Plugin Author Ajay

    (@ajay)

    Hi,

    Yes, that is necessary and typically included in most themes.

    Hi, just wanted to share something that could help others. So i have built this custom post type which display recipes. First it didn’t track anything and I couldn’t fint the “activate_counter” as explained above. However I understood that this piece of code is depended on the <?php the_content(); ?>. After adding this to the custom post type I could then find the “activate_counter” in source could and i seems to be working now.

    However, I like to keep my code clean so its a bit annoying having “the_content” when not needed.

    Plugin Author Ajay

    (@ajay)

    Hejo,

    If you’re writing your own theme / pages to display the custom post types, then you don’t need the_content in there. You can even add the tracking code manually :

    <?php tptn_add_viewed_count( '' ) ?>
    chrishdunn

    (@chrishdunn)

    Fantastic plugin!

    I’m dealing with the issue of needing <?php the_content(); ?> to trigger the counter.

    I tried using <?php tptn_add_viewed_count( ” ) ?> but it didn’t work.

    Currently using <?php the_content(); ?> in a div, and then using display:none; in css to hide it. This gets the counter working but is not ideal.

    Is there an issue with <?php tptn_add_viewed_count( ” ) ?> ?

    Many thanks.

    Plugin Author WebberZone

    (@webberzone)

    There shouldn’t be.

    Do you have the_footer ?

    If so, you can try:

    add_filter( 'the_footer', 'tptn_add_viewed_count' );

    coldpumpkin

    (@coldpumpkin)

    chrishdunn I think it’s <?php echo tptn_add_viewed_count( ' ' ); ?>

Viewing 15 replies - 16 through 30 (of 32 total)
  • The topic ‘Top 10 2.x – Tracking fix’ is closed to new replies.