最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Google analytics not picking up custom post type

programmeradmin0浏览0评论

I have installed a basic google analytics plugin and for the most part it works. It tracks all the pages and even taxonomies but not the custom post type. So, once you drill down on the actual website to:

In google analytics it only goes as far as:

/

leaving off the item.

When I view the source of the custom post type product item page, I can see that the tracking code is there.

Does anyone know why this might be happening?

Post type:

register_post_type('product', array(
'supports'      => array('title', 'editor', 'thumbnail', 'excerpt'),
'rewrite'       => array('slug' => 'product'),
'has_archive'   => true,
'public'        => true,
'labels'        => array(
        'name'         => 'Products',
        'add_new_item' => 'Add New Product',
        'edit_item'    => 'Edit Product', 
        'all_items'    => 'All Products',
),
'menu_icon'     => 'dashicons-cart'

));

Plugin used:

/

发布评论

评论列表(0)

  1. 暂无评论