In this article · 12 sections
- What Google Analytics 4 and Google Tag Manager are, and how they differ
- GA4 through the app or through Tag Manager: which setup to choose
- How to connect Google Analytics 4 to your CloudCart store
- Which ecommerce events CloudCart sends to GA4
- How to add Google Tag Manager to an online store
- What UTM parameters are and how to use them in an online store
- What Consent Mode v2 is and whether you need it
- Why GA4 shows fewer orders than your store
- How to pull GA4 and store numbers through Claude or another AI agent
- 4 best practices for GA4 and Tag Manager in an online store
- GA4 and Tag Manager mistakes that cost you data
- Frequently asked questions
In short: Google Tag Manager (GTM) is the container for your store's tags, and Google Analytics 4 (GA4) measures what visitors do. In CloudCart, GA4 connects with one Measurement ID (G-…) and sends 12 ecommerce events by itself, from view_item_list to purchase. GTM is added with a GTM-… container ID, and Consent Mode v2 is switched on in the GDPR app.
Below: the difference between GA4, GTM and the Google tag, the setup steps in the CloudCart admin, every event the store sends, a UTM naming system, Consent Mode v2 for EU visitors and why GA4 never matches your orders exactly. Written by the CloudCart team, the Bulgarian ecommerce platform, for stores selling in or from Bulgaria and across the EU; CloudCart facts come from the platform documentation and the pricing page.
What Google Analytics 4 and Google Tag Manager are, and how they differ
Google Analytics 4 collects and reports the data. Google Tag Manager decides which scripts run on which page. GA4 answers "where did people come from and what did they do". GTM answers "which tag fires when". Both are Google products with no fee for small and mid-sized stores.
A tag is a snippet that sends data to an outside service such as GA4, Google Ads or Microsoft Clarity. The Google tag (gtag.js) is that snippet for Google's products. GTM is a container for many tags, their triggers (when to fire) and variables (what data to carry). The data layer is the object on the page from which tags read the product, cart and order (Google: The data layer).
| Tool | What it does | Where to set it up in CloudCart | ID format |
|---|---|---|---|
| Google Analytics 4 | Collects and reports sessions, events, purchases | Apps → Google Analytics | G-XXXXXXXXXX |
| Google Tag Manager | Runs all your tags from one interface | Apps → Google Tag Manager | GTM-XXXXXXX |
| Data Layer | Feeds GTM page, product, cart and customer data | Apps → Data Layer (install only, no settings) | none |
| GDPR and Consent Mode v2 | Asks for consent, tells Google's tags what is allowed | Apps → GDPR → Cookies | none |
| CloudCart Analytics | 36 reports on sales, customers, funnel, carts | Analytics in the admin | none, works from day one |
In the feature table on the pricing page, Google Analytics, Google Tag Manager and Facebook Pixel are ticked in all four plans, from Baby Pack to CC Master.
GA4 through the app or through Tag Manager: which setup to choose
For most stores the best setup is GA4 through the Google Analytics app, which sends every ecommerce event without code, and GTM only for tags with no CloudCart app, such as Clarity, Hotjar or LinkedIn.
| Setup | What you switch on in CloudCart | Who it suits | Watch out |
|---|---|---|---|
| GA4 only | Apps → Google Analytics with G-… | A new store, live in 10 minutes | Nothing else to configure |
| GA4 through the app, GTM for the rest | Google Analytics with G-… and Google Tag Manager with GTM-… | Several measurement and ad services | Do not add a second Google tag for the same G-… in GTM |
| Everything through GTM | Google Tag Manager with GTM-… and Data Layer; Google Analytics app off | A specialist with custom events | Every ecommerce event is wired to a tag by hand |
For Google Ads remarketing, the Google Dynamic Remarketing app takes an AW-… ID and a conversion label and sends ecomm_pagetype, ecomm_prodid and ecomm_totalvalue; the CloudCart documentation recommends the cleaner option of the same tag in GTM, fed by the Data Layer. Never run both for one AW-… ID. For Meta and TikTok use the CloudCart apps, which send the standard ecommerce events; the TikTok app can also send purchases from the server (Events API) once you enter the token from TikTok Events Manager.
How to connect Google Analytics 4 to your CloudCart store
GA4 takes about 10 minutes: you create a property and a web stream in Google, copy the Measurement ID and paste it into Apps → Google Analytics. CloudCart recognises GA4 by the G- prefix and sends the storefront events by itself.
- Property in Google Analytics. In analytics.google.com open Admin → Create → Property. Pick the time zone and currency your store reports in (for a Bulgarian store, Bulgaria and euro) so days and totals line up with your store reports.
- Web stream. In Data streams → Web enter the store's domain and copy the G-XXXXXXXXXX Measurement ID.
- The app in CloudCart. In the admin open Apps → Google Analytics and install it. In the Settings tab, edit the "Google Analytics code" field and paste the G-… ID. The app is included in every plan.
- DEBUG mode for testing. Switch on DEBUG mode in the same panel. Events then show up in GA4 DebugView.
- Activate. Turn the app on with Enable. Without a code it stops with "Google analytics tracking ID is required".
- Test order. Open the store in a new window, view a product, add it to the cart and complete an order. In GA4 → Admin → DebugView you should see view_item, add_to_cart, begin_checkout and purchase.
- Key event and end of the test. In Admin → Data display → Events check that purchase is marked as a key event. Switch DEBUG mode off.
Important: browsing the storefront while logged in to the admin sends no events to GA4, and neither do bots such as Googlebot. Test in a separate window without an admin login.
Standard GA4 reports can take 24 to 48 hours, so on day one check Realtime and DebugView. When you migrate to CloudCart, keep the same G-… ID and your GA4 history continues.
Which ecommerce events CloudCart sends to GA4
CloudCart sends 12 events to GA4 using Google's ecommerce vocabulary: from viewing a category to the purchase, plus login and sign-up. The events leave the buyer's browser through gtag.js and carry the products, quantity, price and currency that GA4 shows in its Ecommerce reports (Google for Developers: Measure ecommerce).
| Event | When CloudCart sends it | What it helps you decide |
|---|---|---|
| view_item_list | Category, collection, brand, tag or search results | Categories whose products nobody opens |
| view_item | Product page | Products with many views, few sales |
| add_to_cart, remove_from_cart | Adding to and removing from the cart | Add-to-cart rate per product |
| add_to_wishlist | Adding to favourites | Products for a "back in price" campaign |
| view_cart | Cart page | How many carts reach checkout |
| begin_checkout | Start of checkout | Drop-off between cart and delivery details |
| add_shipping_info | Shipping method chosen | Whether delivery price or type stops buyers |
| add_payment_info | Payment method chosen | Drop-off at the payment step |
| purchase | Thank-you page after the order | Revenue and average order by channel |
| login, sign_up | Login and registration | Share of registered buyers |
Three CloudCart rules explain most support questions:
- purchase is sent once per order. Reloading the thank-you page does not count a second one.
- refund is not sent. A returned order stays in GA4 as a purchase unless you send refunds yourself through GTM or the Measurement Protocol.
- select_item is not sent. A click on a product card in a list does not reach GA4.
These events build the funnel: in GA4 → Explore → Funnel exploration set view_item, add_to_cart, begin_checkout, add_payment_info and purchase, broken down by device category. A big drop between begin_checkout and add_shipping_info usually means the delivery price appears too late.
How to add Google Tag Manager to an online store
Google Tag Manager goes into CloudCart through one field: the container ID in the GTM-XXXXXXX format. CloudCart adds the standard GTM snippet in the <head> and the <noscript> part in the <body> of every page, and you manage tags, triggers and variables in tagmanager.google.com.
- Account and container. In tagmanager.google.com create an account and a Web container for the store's domain. Copy the GTM-… ID.
- The app in CloudCart. Apps → Google Tag Manager → Settings, field "Insert the code provided by Google Tag Manager". Paste the GTM-… ID and save. A wrong format returns "The Google Tag ID is invalid". One store has one container.
- The data layer. Install Apps → Data Layer. It has no settings: install it and the data starts flowing. Without it GTM loads but gets no products, cart or order.
- Tags. In GTM add the tags you need, for example Microsoft Clarity on all pages or Google Ads Conversion Tracking on the purchase. Add a Conversion Linker tag on all pages too if you measure Google Ads through GTM.
- Preview. Click Preview in GTM and open the store. Preview mode works on the CloudCart storefront without extra setup (Tag Manager Help: Preview and debug). Place a test order and check that every tag fires once.
- Publish. Click Submit and name the version, for example "Clarity + Google Ads purchase". If something breaks, you roll back to the previous version in one click.
What is in the CloudCart data layer
The Data Layer app writes a cc_page_data object on every page by type (home, product, category, cart, checkout, thank-you page and others), and a second request brings cc_customer_data for the logged-in customer, so cached pages carry no personal data. Two fields matter for triggers: js_events: false when the thank-you page opens a second time (add it to your purchase trigger so repeats are not counted) and cpadm = 1 when an administrator browses the storefront (exclude those visits).
What UTM parameters are and how to use them in an online store
UTM parameters are labels at the end of a link that tell GA4 and CloudCart where a visitor came from: ?utm_source=viber&utm_medium=message&utm_campaign=black_friday. Google recommends always using the three core ones: utm_source, utm_medium and utm_campaign.
| Parameter | What it tells you | Store example |
|---|---|---|
| utm_source | Who sends the traffic | facebook, instagram, viber, newsletter, partner_blog |
| utm_medium | What kind of channel | cpc, paid_social, email, sms, social, affiliate |
| utm_campaign | Which campaign | black_friday, new_collection_winter |
| utm_content | Which ad or link variant | video_15s, banner_top, button_footer |
| utm_term | Which keyword (paid search) | womens_boots |
- Pick a naming system. Write the allowed source and medium values in one sheet. GA4 is case-sensitive, so "Facebook" and "facebook" become two rows.
- Build the link. Use Google's Campaign URL Builder or ask an AI assistant to build the links for the whole campaign at once.
- Tag only external links. A UTM link inside the store, for example from a home page banner, starts a new campaign and wipes the real source.
- Leave Google Ads on auto-tagging. A Google Ads click carries
gclid, and CloudCart recognises it as Google Ads by itself. More in the guide to Google Ads for an online store. - Check after 24 hours. In GA4 → Reports → Acquisition → Traffic acquisition choose "Session source / medium", and in CloudCart open the report below.
Marketing Suite email campaigns get UTMs automatically, with utm_source=cloudcart and the campaign title as utm_campaign, so give campaigns clear titles.
CloudCart records the source of every order even without GA4, by the first visit in the session. Analytics → Sales by Source / Medium ranks revenue by utm_source and utm_medium down to each utm_campaign, and Sales by Traffic Source assigns paid clicks by gclid (Google Ads), fbclid (Meta Ads) and ttclid (TikTok Ads). On the pricing page, "UTM tracking" is ticked for CC Pro and CC Master.
What Consent Mode v2 is and whether you need it
Consent Mode v2 is how a site tells Google's tags whether the visitor has allowed analytics and advertising cookies. For visitors from the European Economic Area, Google requires this consent to be collected and passed on if you want to keep using measurement, ad personalisation and remarketing in Google Ads (Google Ads Help: Consent mode for EEA traffic). A store in Bulgaria, or any EU store, that advertises on Google needs Consent Mode v2 in practice.
It has four signals: analytics_storage, ad_storage, ad_user_data and ad_personalization; version 2 added the last two. Consent Mode does not show a cookie banner itself, it only passes on the choice made in the banner.
| Basic mode | Advanced mode | |
|---|---|---|
| Tags before the choice | Do not load | Load with a "denied" state |
| If the visitor declines | Nothing goes to Google | Cookieless pings go to Google |
| Conversion modelling | General model | Advertiser-specific model, more accurate |
Source for the table: Google Ads Help: About consent mode.
How to switch on Consent Mode v2 in CloudCart
- The GDPR app. Open Apps → GDPR and activate it. It shows the cookie bar or wall, keeps the consent log and passes the choice to the tags.
- Bar or wall. In the Cookies tab choose how the question looks: a bar at the bottom or a wall that covers the page until the visitor chooses.
- The Google Consent Mode group. In the same tab switch on the Google Consent Mode group (on the storefront it is called consent mode for traffic) and confirm. The group is off by default and only you can switch it on.
- Analytics and advertising groups. Google Analytics sits in the Performance group, Google Ads and TikTok Pixel in Targeting. For each group set the default state before the visitor chooses. If you want no analytics or ad script to run before a "yes", set it to "no".
- Check. Open the store in a private window with Google Tag Assistant. Before the choice all four signals should be denied, and after "Accept" they should turn granted.
With the group active, the storefront sends the default denied state before GTM loads and an update after acceptance, so GTM tags can use GTM's consent settings. The choice is kept for one year. See the bar on the Domain, SSL and GDPR page.
Why GA4 shows fewer orders than your store
GA4 counts only the purchases the buyer's browser managed to send, while the store counts every order in its database. A gap of a few percent is normal; a large gap or a sudden drop means the setup changed.
| Cause | What happens | What to do |
|---|---|---|
| Consent declined | A visitor who refused analytics does not send purchase with cookies | Switch on Consent Mode v2; GA4 fills part of the gap with modelling |
| Ad blockers | A browser extension blocks gtag.js | Reconcile with CloudCart orders, which do not depend on the browser |
| Orders entered in the admin or by phone | The buyer never reaches the thank-you page | Look at them separately in Analytics |
| Payment on an external page | The buyer pays at the provider and does not return to the store | Check that the payment redirects back to the thank-you page |
| Different statuses | CloudCart Analytics counts the statuses chosen in its settings; GA4 counts every purchase, cancelled ones included | Compare with all orders for the day |
The opposite, more purchases in GA4 than orders, almost always means a double tag: GA4 from the app and from GTM for the same G-… ID. Remove one. How to reconcile purchases in Meta is in the guide to Meta Ads on Facebook and Instagram.
How to pull GA4 and store numbers through Claude or another AI agent
An AI agent such as Claude Code, ChatGPT Codex or Gemini CLI reads orders, customers and products from CloudCart with a read-only key, and sessions from GA4 through the Google Analytics Data API, so one conversation gives you traffic and revenue together.
- A key for the store. In the admin open Settings → PAT Tokens and create a Read Only token, with an optional expiry and up to 20 IP addresses.
- Connect the assistant. Paste the sentence from the AI assistant for CloudCart page into Claude Code, ChatGPT Codex, Gemini CLI, Cursor or VS Code.
- Access to GA4. Through the Google Analytics Data API with your Google account, or a CSV export from GA4.
- Ask in a sentence. Start with one month and check the number against Analytics before asking for the full report.
4 best practices for GA4 and Tag Manager in an online store
- Keep data for 14 months. GA4 keeps user- and event-level data for 2 months by default; set 14 months in Admin → Data collection and modification → Data retention.
- A UTM naming system. Lowercase, no spaces, the same source and medium values in every campaign.
- Test after every change. New theme, new payment app or new tag: a test order in DebugView and in GTM Preview.
- A weekly check against the store. GA4 purchases against CloudCart orders, by day. A gap larger than usual is the signal to check your tags.
GA4 and Tag Manager mistakes that cost you data
- GA4 twice. The Google Analytics app plus a Google tag in GTM for the same G-… ID double purchases and revenue.
- GTM without Data Layer. The container loads, but purchase tags have no total and no products.
- GDPR app switched off. Without it there is no consent bar and no Consent Mode, and tags run unconditionally.
Frequently asked questions
Create a property and web stream in GA4, copy the G-… Measurement ID, paste it into Apps → Google Analytics → Settings in CloudCart and activate the app. The store sends the ecommerce events itself; check them with a test order in DebugView.
A Google tool for running your site's tags (GA4, Google Ads, Clarity) without touching code. The standard version has no fee. In CloudCart you connect it with the GTM-… ID in Apps → Google Tag Manager, in every plan.
No. The Google tag (gtag.js) is one snippet that sends data to GA4 and Google Ads. GTM is a container for many tags with rules for when they fire. CloudCart's Google Analytics app uses the Google tag.
GA4 counts only purchases the browser managed to send; the store counts every order. Declined consent, ad blockers, admin orders and external payment pages cause the gap. More purchases in GA4 than orders usually means GA4 is installed twice.
Not for GA4 in CloudCart, because the Google Analytics app sends every ecommerce event. You need GTM for services without an app, such as Microsoft Clarity or Hotjar, and then you install Data Layer too.
Questions about GA4, Tag Manager and tracking in your CloudCart store? Write to support@cloudcart.com.
Sources
- Google: The data layerdevelopers.google.com
- Google for Developers: Measure ecommercedevelopers.google.com
- Tag Manager Help: Preview and debugsupport.google.com
- Google's Campaign URL Builderga-dev-tools.google
- Google Ads Help: Consent mode for EEA trafficsupport.google.com
- Google Ads Help: About consent modesupport.google.com
