WC_Products_Tracking
in package
This class adds actions to track usage of WooCommerce Products.
Table of Contents
- init() : mixed
- Init tracking.
- track_categories_and_tags_view() : mixed
- Send a Tracks event when the Products Categories and Tags page is viewed.
- track_product_category_created() : mixed
- Send a Tracks event when a product category is created.
- track_product_published() : mixed
- Send a Tracks event when a product is published.
- track_product_updated() : mixed
- Send a Tracks event when a product is updated.
- track_product_updated_client_side() : mixed
- Track the Update button being clicked on the client side.
- track_products_view() : mixed
- Send a Tracks event when the Products page is viewed.
Methods
init()
Init tracking.
public
init() : mixed
Return values
mixed —track_categories_and_tags_view()
Send a Tracks event when the Products Categories and Tags page is viewed.
public
track_categories_and_tags_view() : mixed
Return values
mixed —track_product_category_created()
Send a Tracks event when a product category is created.
public
track_product_category_created(int $category_id) : mixed
Parameters
- $category_id : int
-
Category ID.
Return values
mixed —track_product_published()
Send a Tracks event when a product is published.
public
track_product_published(int $post_id, WP_Post $post, bool $update, null|WP_Post $post_before) : mixed
Parameters
- $post_id : int
-
Post ID.
- $post : WP_Post
-
Post object.
- $update : bool
-
Whether this is an existing post being updated.
- $post_before : null|WP_Post
-
Null for new posts, the WP_Post object prior to the update for updated posts.
Return values
mixed —track_product_updated()
Send a Tracks event when a product is updated.
public
track_product_updated(int $product_id, object $post) : mixed
Parameters
- $product_id : int
-
Product id.
- $post : object
-
WordPress post.
Return values
mixed —track_product_updated_client_side()
Track the Update button being clicked on the client side.
public
track_product_updated_client_side(WP_Post $post) : mixed
This is needed because track_product_updated
(using the edit_post
hook) is called in response to a number of other triggers.
Parameters
- $post : WP_Post
-
The post, not used.
Return values
mixed —track_products_view()
Send a Tracks event when the Products page is viewed.
public
track_products_view() : mixed