The new Google Analytics Event Tracking feature is designed to offer custom implementation for WooCommerce stores that use non-standard WooCommerce hooks. This allows for accurate and flexible tracking of eCommerce events tailored to specific customizations in your store.
Overview #
This feature is particularly useful for WooCommerce stores that have implemented custom hooks rather than the standard WooCommerce hooks. It provides two main settings to customize Google Analytics tracking:
- Product Data Collection Method
- Event Selector
Let’s dive into each setting to understand how they can be used to enhance your Google Analytics event tracking.
1. Product Data Collection Method #
The Product Data Collection Method setting allows you to choose separate hooks for tracking events on different pages of your WooCommerce store.
This includes the Product List, Product Detail Page, Checkout Page, and Order Confirmation Page.
Product List #
- Purpose: Tracks WooCommerce product data such as product ID, name, price, and other eCommerce-related data.
- Usage: If Google Analytics eCommerce events such as product impressions, clicks, or add-to-cart actions are not working correctly on your store, you can select a custom hook based on your store’s implementation.
- Implementation: You can choose from various WooCommerce hooks according to the WooCommerce templates used in your store. If your store does not use standard WooCommerce hooks, you can opt for Conversios hooks.
- Conversios Hook: For stores that do not use WooCommerce standard hooks, Conversios hooks can be used. You simply need to add the specified Conversios hook in your WooCommerce template. The documentation provides screenshots and examples for integrating these hooks into the Product List, Product Detail Page, Checkout Page, and Order Confirmation Page.
Product Detail Page #
- Purpose: Collects data related to individual product details.
- Implementation: Choose a custom hook that corresponds to your store’s product detail page implementation.
Checkout Page #
- Purpose: Tracks data during the checkout process.
- Implementation: Select a hook based on how your checkout page is customized.
Order Confirmation Page #
- Purpose: Captures data on the order confirmation page after a purchase is completed.
- Implementation: Choose the appropriate hook to track order confirmation events.
2. Event Selector #
The Event Selector allows for customized event triggering, providing flexibility to handle events that don’t follow standard WooCommerce conventions.
Custom Event Triggering #
- Purpose: Customizes event tracking based on specific criteria, such as CSS classes or IDs, that may differ from WooCommerce standards.
- Example Use Case: If the add-to-cart event relies on a custom CSS class rather than the standard WooCommerce class, you can specify this class in the Event Selector to ensure accurate tracking.
- Implementation: You can define custom events by adding multiple CSS classes or IDs using a comma-separated string. This ensures that the tracking script can recognize and handle events that don’t follow the standard format.
How to Implement these with Conversion Plugin? #
Let’s see how you can integrate your custom google analytics 4 event tracking with Conversios Plugin Step-by-Step:
Step 1. Configure Product Data Collection: #
- Identify and select the appropriate custom hooks for each page type (Product List, Product Detail Page, Checkout Page, and Order Confirmation Page).
- Integrate Conversios hooks if standard WooCommerce hooks are not used.
Step 2. Set Up Event Selector: #
- Define custom event triggers based on your store’s specific requirements.
- Input the relevant CSS classes or IDs to ensure accurate event tracking.
This feature allows WooCommerce store owners to achieve precise Google Analytics event tracking, even when using custom implementations that deviate from the standard WooCommerce setup. By utilizing the Product Data Collection Method and Event Selector, you can ensure that all relevant eCommerce events are accurately captured and reported in Google Analytics.