Overview
Google Analytics 4 module allows you to assign Google Analytics Measurement Id for a Store and measure traffic, ecommerce events to collect information about the shopping behaviour of your users.
Key Features
- Store Configuration.
- Measure ecommerce with Vue B2B Theme and Virto Storefront via Google tag.
- Ready for integration with other sales channels.
- Application menu.
Screenshots
Setup
First, Create and configure Google Analytics 4 Account
Save your Measurement Id.
- Open Virto Commerce Back Office.
- Select Store and Open Store Settings.
- Find Google Analytics 4 section.
- Enable Google Analytics and enter your Measurement Id.
Once you click Save for Store, the Google Analytics tracking will be activated.
Integration with Virto Storefront
Virto Storefront and Vue B2B Theme has native integration with Google Analytics 4 module.
We measures the following actions:
- Select an item from a category
- View product details
- Add/remove a product from a shopping cart
- Initiate the checkout process
- Make purchases or refunds
- Apply promotions
Application Menu
The module adds Google Analytics link into Application menu. It redirects to Google Analytics Dashboard. You could customize Google Analytics Dashboard Url in Platform Settings.
Integration with Custom Application
You can use either Store settings or Rest API to request Google Analytics configuration for store.
Settings
Google Analytics 4 module defines two store settings:
- GoogleAnalytics4.EnableTracking
- GoogleAnalytics4.MeasurementId
Rest API
Get Google Analytics Settings
Endpoint: /api/googleanalytics/{storeId}
Method: GET
Request parameter: Store Id.
Response:
{
"enableTracking": true,
"measurementId": "G-1234567890"
}
Update Google Analytics Settings
Use Store API to provide management above Google Analytics Settings.
Troubleshoting
Enable debug mode so you can see events in realtime and more easily troubleshoot issues.