Advertising shouldn’t just be an expense - it should be a profit-generating activity!
How can you determine which ad campaigns bring the most sales? How do you know where to invest more and where to stop? It’s simple and achievable with a properly configured Google Analytics 4 e-commerce setup - your site’s sales data will feed directly into reports.
We left the term “e-commerce” from the old version of Google Analytics analytics; in the new version of GA4 analytics, “e-commerce” is a purchase event setting with the transfer of financial data about the order and its contents.
Analytics with eCommerce means: analytics with sales financial data, or a configured “purchase” event with financial data.

What e-commerce analytics can reveal for your online store:
- Financial returns from each traffic source.
- Sales breakdown by ad campaigns, ad groups, and keywords.
- Comparison of ad spend with actual sales.
- Insight into decision-making timeframes and the number of sessions before a purchase.
- Average order value, conversion rates, and scaling opportunities for advertising.
- Extended standard traffic reports.
Here’s an example of a traffic source report with e-commerce data:

You can get even more detailed insights by creating custom reports.
How to set up GA4 eCommerce?
➊ On the order thank you page, place the script code that will send successful order data to Google Tag Manager via Data Layer, and then via the event handler in Google Analytics 4.
<script>
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'purchase': {
'transaction_id': 'T12345',
'affiliation': 'holostenko.ua',
'value': '35.43',
'currency': 'UAH',
'items': [{
'item_name': 'Triblend Android T-Shirt',
'item_id': '12345',
'item_price': '15.25',
'item_brand': 'Google',
'item_category': 'Apparel',
'quantity': 1,
}, {
'item_name': 'Triblend Android T-Shirt',
'item_id': '12345',
'item_price': '15.25',
'item_brand': 'Google',
'item_category': 'Apparel',
'quantity': 1
}]
}
}
});
</script>
We pull the following data into the code by variables:
👉 transaction_id – transaction identifier;
👉 value – total transaction amount;
👉 affiliation – name of the store where the sale was made;
👉 items – describes the products in the transaction:
- item_id – product article;
- item_name – product name;
- item_category – category, type or kind of product;
- item_price – price;
- quantity – quantity.
➋ In Tag Manager, create a Google Analytics 4 tag with a “purchase” event containing financial data about the transaction.
Done! How to check the functionality?
Make a test order and check the html code of the order thank you page, if the code has loaded, then go to Google Analytics 4 in the near future and check the information about transactions for today. Now in your reports, where conversions are, there will be a separate option - e-commerce. This is a basic check, we check a little deeper up to sending data to the Data Layer.
If the order is processed on one page or in "1 click", then:
👉 the transaction sending code must be activated upon successful form submission - either through a form submission trigger, or programmatically by activating a script upon form submission.
If you need help setting up e-commerce for effective promotion of an online store - welcome, we provide high-quality website analytics services.
Additionally, we have opened the setup of advanced e-commerce with events from showing the product to the user and ending with its purchase. This type of analytics allows you to build a systemic sales funnel, analyze the effectiveness of each product in the online store and draw specific conclusions. We will need Google Tag Manager and technical support for the site from your side.