WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
JetPack/WordPress.com Stats and Custom Post Types (8 posts)

  1. pcvip
    Member
    Posted 1 year ago #

    Is there any way to get WordPress.com Stats, which I run on my self-hosted site (http://answerguy.com) via Jetpack, to include custom post types in the results/views it counts? I've been searching for this for almost a day and I come up empty!

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Jetpack Stats should already record views on your Custom Post Type pages. Could you check that your template files include the wp_footer function? If this function is missing on your CPT pages, Jetpack won't be able to record any visits.

  3. pcvip
    Member
    Posted 1 year ago #

    Jeremy, I appreciate that. So here's the rub:

    I'm using Headway, which more or less eliminates the standard theme files, functionally replacing them with entries in wp_options. Of course, the files need to exist, and I've got a child theme that's mostly empty but as of about an hour ago includes what I hope is the correct code (first three lines of what follows) in the otherwise-inactive footer.php file. What do you think?:

    FOOTER.PHP====================

    <body>
    <?php wp_footer(); ?>
    </body>

    <?php
    /* Prevent direct access to this file */
    if ( !defined('WP_CONTENT_DIR') )
    die('Please do not access this file directly.');

    /* WordPress and a lot of plugins require the function in this file, so I guess we have to use it :-(. */
    wp_footer();

    HeadwayDisplay::body_close();

    HeadwayDisplay::html_close();

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    It should work indeed, although your code lists the wp_footer function twice.

    Could you log out of our WordPress account, and visit one of your custom post type pages? In the source code at the bottom of the page, you should find the following tracking code:

    <script src="http://stats.wordpress.com/e-201311.js" type="text/javascript"></script>
    	<script type="text/javascript">
    	st_go({v:'ext',j:'1:2.2',blog:'8886389',post:'0',tz:'-4'});
    	var load_cmc = function(){linktracker_init(8886389,0,2);};
    	if ( typeof addLoadEvent != 'undefined' ) addLoadEvent(load_cmc);
    	else load_cmc();
    	</script>
  5. pcvip
    Member
    Posted 1 year ago #

    Indeed, that's there. In fact, it's there even w/o the functions.php dummy, so the framework is, it seems constructed properly (hooray!).

    Of course, the bad news is the whole "then why isn't it working to start with?" issue!

    Is the code in the footer the only delimiter that *should* control this working correctly?

  6. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Could you post a link to one of your Custom Post Type pages so I can have a closer look?

    Thanks!

  7. pcvip
    Member
    Posted 1 year ago #

    Jeremy, I'll do better. Here are two:

    http://answerguy.com/influency-and-integrated-marketing/startup-packages/

    and

    http://answerguy.com/videopost/influency-building-blocks/

    Notice that the SECOND one is a custom post type of a category created in-house, while the first is of a category created by the PREMISE plug-in.

    Also, just for giggles, lemme tell you this: as of right now (9PM EDT), JetPack is showing 183 page views today, while Google Analytics is showing 667.

    I'm accustomed to there being SOME disparity, but that's nuts. Previous to this stuff getting all wiggy both tools ran in the daily range of 400-450. Further, I'm seeing 4.33 views per visit out of GA, which represents a significant jump from the 2.55 we were at FOR BOTH TOOLS before we relaunched using this new system, whereas WP/JP is showing those 183 page views being generated by at least 122 visitors (referral traffic thus far today), so something less than 1.5 pageviews per visit.

    My theory is this: counted or not, sometimes or all the time, under whatever the prevailing circumstances are, I suspect that JetPack is somehow (somehow) tied to the main RSS feed. As I understand things each CPT has its own feed. GA is counting everything, and sometimes (huh?) JP is ... not.

    Which, if true, renders JP pretty much useless.

    So hooray for me, I have a redesigned web site with traffic up 50% in 10 days, across metrics. I have greater user engagement. I rock!

    But ... I sure wish JetPack was working, you know?

  8. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Thanks for the extra details. I forwarded the 2 examples to our data team, and we will investigate further.

    I will get back to you as soon as we can address the issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic