WordPress.org

Ready to get started?Download WordPress

Forums

WP-Piwik
[resolved] Track pages by category/taxonomy? (7 posts)

  1. alxvallejo
    Member
    Posted 2 years ago #

    I'm looking at the documentation on custom tracking: http://piwik.org/docs/javascript-tracking/#toc-manually-trigger-a-conversion-for-a-goal

    So you can set up custom variables for a pageview as such:
    piwikTracker.setCustomVariable (1, $taxonomy, $term, 'page');

    But this would be setup in the javascript. I would need to somehow pass the taxonomy and term to javascript.

    Has anyone dealt with this?

    http://wordpress.org/extend/plugins/wp-piwik/

  2. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Maybe I can add some pre-defined settings (like "category" and "author") to auto-add these as a custom var. Addtionally I can use a post's or a page's custom fields to allow manual-chosen values.

    Would this help?

  3. alxvallejo
    Member
    Posted 2 years ago #

    Well yes, but for me I would need to track the breakdown of custom taxonomies so I'm thinking I need to use wp_localize_script and pass some PHP variables to the javascript term parameters. I'll let you know if it works and if you can think of an alternative approach, even better!

  4. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Hm, I think this won't really work for categories: Custom vars are limited (e.g. 5 vars/(view and/or visit)), but a WordPress post can be categorized to as many categories as you want.

    But author, user role, and some user-specified vars should be possible.

  5. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Alright, but have a look at the custom var limits if you pass your vars to the tracking code.

  6. alxvallejo
    Member
    Posted 2 years ago #

    I thought the index/name is limited to 5 but the value could be anything.

    I'm only expecting to track two taxonomies per page and each taxonomy would be assigned one term. If I assign the value of the first taxonomy to the first term (or deepest child term depending on my php), then only one value would be passed.

    Would that work? I'm assuming that you can have 5 index/names (aka taxonomies) and each can have one value per page.

  7. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Custom variables by post (scope=page) supported in 0.9.6. Release soon.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.