What is Google Analytics 4 ?
Google Analytics 4, also known as GA4, is the latest version of Google’s web analytics platform. It is designed to provide website owners and marketers with a more comprehensive and accurate view of their website traffic and user behavior. Unlike the previous version of Google Analytics, GA4 is built on a new and more advanced data model that uses machine learning to provide deeper insights into user behavior.
It includes a range of new features and capabilities, including event tracking, user-centric measurement, cross-device tracking, and more. It also includes an improved user interface and streamlined setup process, making it easier for users to set up and use the platform.
Overall, this new version, provides a more powerful and insightful view of website traffic and user behavior, enabling businesses and marketers to make more informed decisions and optimize their websites and marketing campaigns for maximum impact.
Integrate Google Analytics 4 In 3 Easy Steps
Step 1 – Install FREE Plugin
composer require croapp/integration
php bin/magento maintenance:enable
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento maintenance:disable
php bin/magento cache:flush
Step 2 – Get Measurement ID From GA4
- Login to your google analytics account
- Navigate to
admin
-> select the desired account & property - Click on
Data Streams
in Property - Click on data stream or create a new one
- Copy
MEASUREMENT ID
Step 3 – Configure GA4 In Magento 2
- Navigate to
Stores
->Configuration
- From the left sidebar/menu, click on
CRO App / GA 4 Configuration
underCRO App / GA 4
- Enter the
MEASUREMENT ID
copied from previous step inGA 4 Configuration Section
->GA-4 Measurement ID
- Click
Save Config
on top right of the page - Clear cache from
System
⇨Cache Management
List Of Events Added By Plugin
home_viewed
– Tracks homepagecontent_page_viewed
– Triggered on content cms pages like About US, Contact USview_item_list
– Tracks category pages i.e tracks category pages.view_item
– Triggered on product page i.e tracks products views / impressions / pages.view_search_results
– Triggered on search results pagesign_up
– Triggered when customer is registered in frontend i.e track customer registrations in GA4.login
– Triggered when customer logs in to account i.e tracks customer logins.logout
– Triggered when customer logs out from his account i.e tracks customer logoutsadd_to_cart
– Triggered when user adds a product to cart i.e tracks add to carts.remove_from_cart
– Triggered when user removes a product from cartview_cart
– Triggered when user visit cart pageadd_to_wishlist
– Triggered when user adds product to wishlistadd_to_compare
– Triggered when user tries to add a product to his compare listremove_from_compare
– Triggered when user removes a product from his compare listbegin_checkout
– Triggered when user visits checkout pagepurchase
– Triggered when user completes order and visits order success page i.e tracks transactions / orders in magento 2
Notes
- Some events like
add_to_cart
,remove_from_cart
may not trigger- Until page is reloaded.
- Or if some cache plugin installed in magento prevents it, then in that case it will be triggered when user visits a dynamic page like cart page.