eCommerce Tracking using GA4

eCommerce Tracking using GA4

This article will show you how to set up eCommerce tracking for your?Google Analytics 4 property?with Google Tag Manager, WooCommerce, and GTM4WP. Google Analytics 4 or GA4 is the next generation of the popular free tool Google Analytics. It uses a completely different data model as well as new reports and user interface. GTM4WP uses the?recommended event names?of Google to send e-commerce actions like add to cart, product click, or purchase.

This article is for users of Google Tag Manager for WordPress plugin v1.12 or newer. If you are using an older version of my plugin, please consider upgrading.

If you are looking for setup instructions for your Universal Analytics or GA3 tags, please visit the?GA3 version?of this article.

Step 1: Google Analytics 4 configuration variable

You do not need to set up anything in your Google Analytics 4 properties. It will automatically pick up eCommerce events and data and show you the results in?monetization reports.

In your Google Tag Manager container, you will first need to add a Google Analytics 4 configuration tag if you haven’t added it yet. This will store your Google Analytics 4 web stream ID (G-XXXXXXXXX) and every global attribute you set in it. It will also send a page_view event if you do not change the default behavior of the tag.

No alt text provided for this image

  • Start adding a?new tag
  • Select?Google Analytics: GA4 Configuration
  • Enter your?Google Analytics 4 measurement ID?(also known as web stream ID)
  • If you are unsure what?other options?need to be set in this tag, leave everything else in its default state
  • Enter a name?at the top of the panel (in the example below you see: GA4 – Pageview – All pages
  • Save?the new tag

No alt text provided for this image

Step 2: import GTM for Google Analytics 4

  • Contact Devsatva.com for GTM container Template
  • On the Google Tag Manager UI,?open Admin / Container / Import Container:
  • Select the previously downloaded file
  • We highly recommend creating a new workspace?during the import process (enter a workspace name you wish)
  • Select the?Merge?import option
  • To stay on the safe side, select?Rename conflicting tags, triggers, and variables
  • You should see?only “New” items?in the summary table. If you see modified or deleted items as well, check the details in consult with a Google Tag Manager expert if needed
  • Click the?Confirm?button to proceed

This import process will create the following new trigger in the workspace

  • Event – Ecommerce Events GA4: it will fire on all eCommerce events in your WooCommerce shop

The following variables will be created:

  • Ecommerce: helper variable to pull the most recent eCommerce data from?the data layer
  • Ecommerce Items: returns the most recent product data in the data layer. You can use this variable in a Google Ads Remarketing tag to populate dynamic remarketing data
  • Ecommerce Transaction ID: the order ID on the order received page. You can use this variable in other tags where you need to transmit the ID of the order just placed on your site
  • Ecommerce Value: the total value of the order on the order received page. You can use this variable in other tags where you need to transmit the value of the order just placed on your site
  • Ecommerce Tax: the total tax value of the order on the order received page
  • Ecommerce Affiliation: usually empty, could include any affiliate partner name in the future
  • Ecommerce Shipping: the total shipping cost of the order on the order received page
  • Ecommerce Coupon: it includes all coupon codes in a comma-separated list that has been redeemed during checkout (variable populated only on the order received page)
  • Ecommerce Currency: the currency used in the last eCommerce action. You can use this variable in other tags where you need to transmit the currency of the order just placed on your site

The following tag will be created:

  • GA4 – Event – Ecommerce events: fires using the trigger described above, uses the event name of the last eCommerce action using the?recommended retail event names?of Google. Includes all the required eCommerce parameters using the variables listed above

No alt text provided for this image

  • In Step 1, you either already had a “Google Analyitcs 4: GA4 configuration tag” or you created it while going through the steps
  • Open?the “GA4 – Event – Ecommerce events” tag that has been just created in Step 1
  • Open?the list in the?Configuration Tag drop down
  • Select your GA4 configuration tag?(the name might be different than on the screenshot above)
  • Save?the changes

Publish everything.

All done!

At this point, you set up everything to track eCommerce for Google Analytics 4 in your WooCommerce store. Enjoy! ??

Anton Vlasenko

Founder & CEO at Venner. Real Estate Tokenization Platform (RWA). Entrepreneur and Crypto Investor. BD & Advisor at Sabai Protocol. Blockchain, Web3, Real Estate & Investment.

2 年

Hemang, thanks for sharing!??

回复

要查看或添加评论,请登录

Hemang Vyas的更多文章

社区洞察

其他会员也浏览了