• Resolved Jason Judge

    (@judgej)


    I may just be missing it, but I can’t see how to track the Post Type and the Post ID as a custom dimension. This would be very useful to be able to report on individual article stats and to provide summary reports for specific custom post types, such as “articles” or “products”.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Jason Judge

    (@judgej)

    I am guessing the stats are logged by URL at the moment, which is fine so long as the URL slug does not change.

    Edit: just tried that. As soon as the URL changes, the stats for the page are then inaccessible from the page at its new location.

    • This reply was modified 7 years, 10 months ago by Jason Judge.
    Thread Starter Jason Judge

    (@judgej)

    Oh, and tracking custom fields as dimensions. The power that would give us! Categories and tags are great for blogs, but custom metadata against posts is where the real stuff is that we would want to report.

    As an aside, are there any filters or actions that let a third-party plugin add this extra tracking to your plugin? Obviously just one plugin in a WP install needs to take control of loading up the Google Analytics tracking code. But taking control of that means it should ideally provide the means for other plugins to add to what gets tracked when it goes beyond what that controlling plugin can do out of the box.

    As you said above all the suggestions you’ve made, to be implemented, will need a custom tracking code. GADWP 4.9 and lower provides a hook to add things to the tracking code and from GADWP 5.0 the tracking component is designed to allow full customization of the code.

    The features you’re requesting are different from the ones already implemented, requiring custom made add-ons for each usage case (it’s not a one for all solution).

    • This reply was modified 7 years, 10 months ago by Alin Marcu.
    Thread Starter Jason Judge

    (@judgej)

    Fantastic ??

    Will the hook work the same in 5.0 as it does in 4.9? Just wondering whether it is worth diving into the hooks now, or waiting for 5.0 to come out and do the configuration through the GUI.

    Thread Starter Jason Judge

    (@judgej)

    The ga_dash_addtrackingcode action hook is great for adding new custom dimension data. I wonder if you could pass $this as a parameter, or at least $this->gawp. That way the hooked code has access to the settings and so on for your plugin without having to go out to globals.

    Another place where an action would be very useful, is the events-unieveral.php event tracking code, within the $(window).load(function() {...}. I realise we can add that jQuery wrapper ourselves, but it is nice for all the event-based tracking code to be collected together in one place like this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Tracking Post ID and Post Type as Dimensions?’ is closed to new replies.