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!
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.
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?:
<?php wp_footer(); ?>
/* 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 :-(. */
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:
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?
Could you post a link to one of your Custom Post Type pages so I can have a closer look?
Jeremy, I'll do better. Here are two:
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?
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.
This topic has been closed to new replies.