This article will help you connect your TronShop to Google Analytics 4 through Google Tag Manager, without writing any scripts
With Native analytics, your shop sends the standard Google Analytics 4 (GA4) ecommerce events by itself: product views, cart, checkout, purchases, leads and more. You only enter your Google Tag Manager container ID. You no longer need to add tracking code as External Scripts, and the tracking keeps working when your shop design changes.
Native analytics works through Google Tag Manager only. Your Google Analytics measurement ID (G-…) is not entered in the shop; it goes into a tag in your Tag Manager container. This article covers both sides: the shop settings and the container.
Where in admin: Settings → Integrations → Analytics
On this page
- Native analytics on or off
- Before you start
- Switching on Native analytics
- Native settings: revenue basis, item ID, user ID
- Cookie bar and Consent Mode v2
- Setting up your Google Tag Manager container
- Setting up your Google Analytics property
- Events your shop sends
- What to expect in Google Analytics
- Checking that it works
- Troubleshooting
Native analytics on or off
On the Analytics page, the section Native analytics has one switch, Native Google Analytics:
| Native Google Analytics | What it does |
| Switched off (default) | Nothing changes: your shop and your External Scripts work as before, with all their {{…}} placeholders, including the Google Analytics item placeholders such as {{DATALAYER_ITEMS}}. If you track with your own Google Analytics or Tag Manager scripts, they keep working. |
| Switched on | The shop loads your Google Tag Manager container on every page, sets Google Consent Mode v2 from the shop's cookie bar and sends the GA4 events listed below. Requires a GTM Container ID. |
Use either Native analytics or your own Google Analytics scripts, not both at once. The Google Analytics item placeholders keep working while Native is on, but a script that sends them next to Native counts every purchase twice.
Before you start
You need your own Google accounts. TronShop does not create them for you.
-
A Google Analytics 4 property with a web data stream for your shop. You will need its measurement ID (
G-…) for the Tag Manager container; see Setting up your Google Analytics property for the property settings. See Google's guide Set up Analytics for a website. -
A Google Tag Manager container of the type Web. Its ID looks like
GTM-XXXXXXXand is shown at the top of your Tag Manager workspace. See Google's guide Create an account and container. You only need the ID: do not paste Google's installation code into your shop, because TronShop adds it for you. - The shop's cookie bar turned on: Settings → Visual Settings → Footer → Show cookies GDPR stripe. See Cookie bar and Consent Mode v2 for why.
- A list of your current tracking scripts. Open Settings → Advanced Settings → External Scripts and note every script that loads Google Analytics, gtag.js or Google Tag Manager, or sends ecommerce events. If you followed our articles Google Tag Manager – Data Layers, Install the Google tag (gtag.js) or Setup the Google Consent Mode v2, those are the scripts you will turn off.
Switching on Native analytics
PLEASE TAKE ATTENTION
Turn off your old Google Analytics, gtag.js and Tag Manager External Scripts in the same step as you switch to Native. If you leave them on, Tag Manager loads twice and every purchase is counted twice in Google Analytics (and in every other tag that fires on purchase, such as Google Ads or Meta).
- Prepare your Tag Manager container first (see Setting up your Google Tag Manager container), so that the events have tags from the first minute.
- Go to Settings → Integrations → Analytics.
- Under Native analytics, turn on Native Google Analytics. A blue note reminds you to turn off the old scripts, and the GTM Container ID field appears. If an enabled External Script contains a Google Analytics measurement ID (
G-…) or a purchase event, the warning An External Script may still send Google Analytics events lists it by name, with the link Open External scripts. - Enter your container ID in GTM Container ID, in the format
GTM-XXXXXXX. - Check the Revenue basis, Item ID and User ID settings below (see Native settings). The defaults suit most shops.
- Save the page.
- Right away, go to Settings → Advanced Settings → External Scripts and turn off (change the State) or delete every script that loads Google Analytics, gtag.js or Google Tag Manager, calls
gtag(…), or pushes ecommerce events such aspurchaseoradd_to_cart. - Keep the scripts for other services, for example review widgets or advertising pixels. Order placeholders such as
{{TRANSACTION_ID}}and{{TRANSACTION_REVENUE}}keep working whether Native is on or off. - In Google Analytics, add an annotation on the switch date: revenue is counted differently from now on (see What to expect).
PLEASE TAKE ATTENTION
• With Native on, your shop defines its own gtag() function. An old script that called gtag() without loading Google's code did nothing before; after the switch it starts sending data. Turn such scripts off too.
• An old purchase script left on still fires on the order confirmation page, with its items, next to the Native purchase, so every purchase is counted twice.
Native settings: revenue basis, item ID, user ID
These three sections appear only while Native Google Analytics is on.
Revenue basis
Decides whether item prices, the event value and shipping are sent with or without VAT. Tax is always sent separately as the VAT amount.
- Follow price display (default): the same VAT treatment as the prices shown in your shop.
- Always with VAT: prices, value and shipping including VAT.
- Always net: prices, value and shipping excluding VAT.
Item ID
Which code of the product model Google Analytics shows as the item ID. Every variant of a product (colour, size) has the same item ID on every event, from the product list to the purchase; the variant is sent separately as item_variant.
- Shop display code (default): the code your shop shows to customers (your own, the supplier's or the PromoTron code, according to your product code priority).
- PromoTron code: always the PromoTron catalogue code.
Pick the code your other tools use (for example your product feed), so reports can be matched. Decide once: if you change the item ID later, Google Analytics treats the same product as a new item and its history is split.
User ID
Switch on Include logged-in customer ID to send the customer's ID as user_id, so Google Analytics can recognise the same customer on different devices. It is off by default. The ID is an internal number, not an e-mail or name, and it is sent only for logged-in customers who accepted Tracking cookies in the cookie bar. The Google tag from the import in Setting up your Google Tag Manager container already passes it to Google Analytics (configuration parameter user_id with the value {{DLV - user_id}}).
Cookie bar and Consent Mode v2
In Native mode your shop handles Google Consent Mode v2 for you. You do not need the consent scripts from our article Setup the Google Consent Mode v2; turn them off.
- On every page, all consent signals start as denied (functional storage is always granted).
- The visitor's choice in your shop's cookie bar then updates them: Tracking cookies grant analytics storage, Marketing cookies grant the advertising signals (
ad_storage,ad_user_data,ad_personalization). - When the visitor changes the choice, the shop updates the consent and sends a
consent_updateevent.
PLEASE TAKE ATTENTION
Native analytics needs the cookie bar. The visitor's choice in the bar is the only way consent can be granted. If the bar is off, every visitor stays denied: Google Analytics receives only cookieless pings and no user ID is sent. The Analytics page shows a warning The cookie bar is turned off in that case. Turn on Show cookies GDPR stripe in Settings → Visual Settings → Footer.
Tag Manager itself loads before the visitor makes a choice (what Google calls advanced consent mode). Until consent is granted, Google tags send only cookieless pings. If your company policy requires that Google Tag Manager does not load at all before consent, Native mode does not offer that option. Make sure your tags in Tag Manager respect Consent Mode; see Google's Tag Manager consent mode support.
Setting up your Google Tag Manager container
Your shop puts the events into the data layer of the page. Tag Manager decides what is sent on to Google Analytics, and it sends nothing it has no tag for.
PLEASE TAKE ATTENTION
A container that holds only the Google tag sends page_view and nothing else. Google Analytics does not read the ecommerce data from the data layer by itself: every event in the list below needs its own Google Analytics: GA4 Event tag, fired by a Custom Event trigger with the event name, and the ecommerce tags need Send ecommerce data set to Data layer. Without these tags your reports show visits, but no products, carts or purchases.
You need three things in the container: the Google tag with your measurement ID, the event tags, and a published version. All of it is ready-made: download the import file below and import it, or build the tags by hand.
Step 1: import the ready-made tags
Download the import file: tronshop-native-ga4-gtm-import.json.
The file contains everything for the events the shop sends, including the Google tag, and nothing else. It does not change the tags you already have.
| What the import adds | Details |
The Google tag GA4 - Google tag
|
Loads Google Analytics on Initialization – All Pages and sends the page_view of every page (the automatic page view stays on). It passes the logged-in customer's user_id when you switched on Include logged-in customer ID in the shop, and adds page_type, language, shop_code and logged_in to every event. This tag is the only source of page_view; do not create a separate page view event tag. |
17 tags GA4 - …
|
One Google Analytics: GA4 Event tag per event. The 12 ecommerce tags (view_item, view_item_list, select_item, view_cart, add_to_cart, remove_from_cart, begin_checkout, add_shipping_info, add_payment_info, purchase, view_promotion, select_promotion) have Send ecommerce data set to Data layer. The other five send their own parameters: search (search_term), login and sign_up (method), generate_lead (form_id, form_destination), share (method, content_type, item_id). |
18 triggers CE - …
|
A Custom Event trigger per event name. CE - consent_update has no tag of its own; it is there for your own tags that should react when the visitor changes the cookie choice. |
| 33 variables | 32 Data Layer Variables DLV - … for every field the shop sends (items, value, currency, transaction_id, page_type, user_id and so on) and one Constant Const - GA4 Measurement ID. The Google tag and all 17 event tags take their measurement ID from this constant, so you enter your G-… once. |
- In Tag Manager open Admin (top menu) and, in the Container column, click Import Container.
- Under Choose container file select the downloaded
tronshop-native-ga4-gtm-import.json. - Under Choose workspace pick Existing and your current workspace (or New if you prefer to review the import separately).
- Under Choose an import option pick Merge and Rename conflicting tags, triggers and variables. Never choose Overwrite: it would delete your existing tags.
- The preview lists what will be added: 18 tags, 18 triggers and 33 variables (34 if Tag Manager counts the built-in Event variable), and nothing modified or deleted. If the preview shows modifications or deletions, cancel and check the import option. Click Confirm.
TIP
The imported tags and triggers are named GA4 - … and CE - …. If your container already uses these names, Tag Manager keeps your originals and gives the imported ones a suffix; delete whichever copy you do not need.
Step 2: your measurement ID and an existing Google tag
- Open Variables → User-Defined Variables → Const - GA4 Measurement ID and replace the placeholder
G-XXXXXXXXXXwith your measurement ID (G-…, from Setting up your Google Analytics property). Save. - Open Tags and look for another tag of the type Google tag (or an older Google Analytics: GA4 Configuration tag) with the same
G-…. If there is one, keep only one of the two: delete it, or delete the importedGA4 - Google tagand add theuser_idconfiguration parameter with the value{{DLV - user_id}}to yours. Two Google tags for the same measurement ID can count page views twice.
Step 3: preview and publish
- Click Preview and enter your shop address. Accept the cookies in the cookie bar, open a product, add it to the cart. In Tag Assistant, every event from the shop should show one
GA4 - …tag under Tags Fired, and Initialization should show your Google tag. - Click Submit, give the version a name, and Publish. Until the version is published, the live shop still runs your previous container version.
Building the tags by hand instead
If you cannot import, the same result can be built manually. The quickest setup uses a Google tag and two event tags that forward the event name as it is:
- A Google tag with your measurement ID as Tag ID and the trigger Initialization – All Pages. Leave the automatic page view on. If you switched on Include logged-in customer ID in the shop, create a Data Layer Variable
user_idand add it under Configuration settings as the parameteruser_id. - A Google Analytics: GA4 Event tag with your Measurement ID, Event Name
{{Event}}(the built-in variable), More Settings → Ecommerce → Send ecommerce data with the data source Data layer, and a Custom Event trigger with Use regex matching on and the event name^(view_item|view_item_list|select_item|view_cart|add_to_cart|remove_from_cart|begin_checkout|add_shipping_info|add_payment_info|purchase|view_promotion|select_promotion)$. - A second Google Analytics: GA4 Event tag, Event Name
{{Event}}, without ecommerce data, with a regex Custom Event trigger^(search|login|sign_up|generate_lead|share)$. To attach the parameters of these events (search_term,form_id,method), create Data Layer Variables with those names and add them as event parameters.
Do not include page_context or consent_update in the triggers, and do not use a trigger on All Custom Events: the page view would be counted twice. Google's guide Measure ecommerce describes the GA4 ecommerce events and their parameters.
Setting up your Google Analytics property
These settings are made in Google Analytics (not in Tag Manager and not in the shop). You need the Editor role on the property.
-
Property and data stream. Create a Google Analytics 4 property with a Web data stream for your shop address, or open your existing one. In the stream details copy the Measurement ID (
G-…); it goes into theConst - GA4 Measurement IDvariable in Tag Manager (or into your Google tag if you build the tags by hand). Google's guide: Set up Analytics for a website. -
Key events.
purchaseis a key event by default. Markgenerate_leadas well, so inquiries and contact forms count as conversions: Admin → Data display → Key events → New key event, entergenerate_lead. (Once the event has arrived, you can also toggle it in Admin → Events.) -
Custom dimensions. The purchase carries the payment method and the delivery method, but Google Analytics shows them in reports only after you register them: Admin → Data display → Custom definitions → Create custom dimension, scope Event, event parameter
payment_type; repeat forshipping_tier. Optional: an Item-scoped dimension foritem_type(productorprint) to split goods from printing in item reports. Dimensions apply from the day they are created. -
Site search off. Open Admin → Data collection and modification → Data streams → your stream → Enhanced measurement, click the gear and switch Site search off. The shop already sends its own
searchevent with the search term; with Site search on, a search can be counted twice (searchfrom the shop andview_search_resultsfrom Google). The other enhanced measurements can stay on. - Consent. Nothing to set in Google Analytics, but the shop's cookie bar must be on (see Cookie bar and Consent Mode v2); without it Google Analytics receives only cookieless pings.
- Currency. Check that the property's reporting currency (Admin → Property details) is the one you want to see; events arrive in the shop currency and Google converts them.
Events your shop sends
Ecommerce events carry their data (currency, value, items and so on) in the standard ecommerce object. Amounts are in the currency the visitor selected; a purchase is in the order currency.
| Event | When it is sent |
view_item_list |
A product list is shown: a category page, a homepage product collection, or similar products |
select_item |
The visitor clicks a product card in a list or homepage collection |
view_item |
The visitor opens a product detail, and again when they switch to another variant |
add_to_cart |
Products (including print) are added to the cart, or the quantity of a cart item is raised, with the real cart price after quantity tiers and discounts |
remove_from_cart |
The visitor removes an item from the cart or lowers its quantity |
view_cart |
The visitor opens a cart that is not empty |
begin_checkout |
The visitor starts the checkout (once per cart content) |
add_shipping_info |
A delivery method is selected at checkout (also a pre-selected one), and each time it changes |
add_payment_info |
A payment method is selected at checkout (also a pre-selected one), and each time it changes |
purchase |
The order confirmation page, once per order. Includes the order number, value, tax, shipping, coupon, payment method (payment_type), delivery method (shipping_tier) and your shop name (affiliation) |
view_promotion |
A banner is at least half visible on screen |
select_promotion |
The visitor clicks a banner |
search |
The visitor submits a search, with the search term |
login |
The visitor logs in |
sign_up |
The visitor registers, completes a registration, or creates an account during checkout |
generate_lead |
An inquiry form, a product sample request or the contact form is sent successfully. The form is identified in form_id
|
share |
The visitor shares a product through the social sharing buttons |
page_context |
Every page, before Tag Manager loads. Carries page details (page type, language, currency, logged-in state, and the user ID when allowed) for use as Data Layer Variables |
consent_update |
The visitor changes their choice in the cookie bar |
PLEASE TAKE ATTENTION
The first event on each page is called page_context, not page_view. The page view itself is sent by your Google tag. Do not create an event tag for page_context, and do not build triggers that wait for a page_view custom event from the shop: there is none, and using it would count every page twice.
What to expect in Google Analytics
-
Revenue looks lower than before. Native reports the value of the goods: products, print and other charges, minus coupon discounts. Delivery and the payment fee are not included. With Follow price display on a shop that shows prices without VAT, the value is also net. The old
{{TRANSACTION_REVENUE}}placeholder was the full order total including delivery, payment fee and VAT. Your sales have not changed, only what is counted as revenue. Always with VAT brings VAT back in; delivery and the payment fee stay out, as Google defines it. - Enhanced Conversions are not available in Native mode: the customer's e-mail is not sent. If you use Enhanced Conversions, keep the External Script that sends the e-mail for them.
-
No Google Ads conversion event is sent. Set up Google Ads conversions in Tag Manager, for example on the
purchaseevent. -
Payment and delivery method are on every purchase (
payment_type,shipping_tier), but appear in reports only after you register them as custom dimensions (see Setting up your Google Analytics property). -
Shops that hide prices (quotation mode, prices for logged-in customers only) send product views, lists and cart events without
priceandvalue. -
Quote requests are not purchases. In quotation (demand) mode a submitted demand sends no
purchaseevent, so it never counts as revenue. - Google Analytics can take up to 24–48 hours to show new data in standard reports. Use the checks below to see events immediately.
Checking that it works
- In Google Tag Manager, click Preview and enter your shop address. Google's guide: Preview and debug containers.
- In the shop window that opens, accept the cookies in the cookie bar.
- Browse a category, open a product, add it to the cart and go to checkout. In Tag Assistant you should see
page_contexton every page, thenview_item_list,view_item,add_to_cart,begin_checkoutand so on, each with itsGA4 - …tag under Tags Fired. An event with no tag fired means the event tags are missing from the container or not published yet. - Make sure your container is listed only once. If you see it twice, an old External Script still loads Tag Manager: turn it off.
- In Google Analytics, open DebugView (under Admin) to see the events arrive while Tag Manager preview is on, or Reports → Realtime for the event names of the last 30 minutes. Google's guide: Monitor events in DebugView.
- To check purchases, place a test order and confirm that exactly one
purchaseevent appears.
Troubleshooting
| What you see | What to do |
| “GTM Container ID must match the format GTM-XXXXXXX.” or “GTM Container ID is required when Analytics mode is Native.” | Copy the container ID from Google Tag Manager. It starts with GTM- followed by letters and numbers. Do not use the GA4 measurement ID (G-…). |
| “Analytics settings are not synchronised to this shop yet…” when saving | Your shop has not yet received the latest settings data. Wait for the next data synchronisation and save again. If the message is still there later, contact our Support Team. |
| Google Analytics shows page views, but no products, carts or purchases | Your container has only the Google tag. Import the event tags and publish the container (see Setting up your Google Tag Manager container). In Tag Assistant the events appear with nothing under Tags Fired. |
| Events arrive, but no page views and no user ID | Your container has no Google tag, for example because it was deleted by an import with Overwrite. Import the file again with Merge (see Setting up your Google Tag Manager container), or create the Google tag by hand, and publish. In Tag Assistant, Initialization shows no Google tag. |
| Events arrive, but without items, value or revenue | The event tag was built by hand without Send ecommerce data → Data layer, or the Measurement ID in the tags is still the placeholder G-XXXXXXXXXX. Check the Const - GA4 Measurement ID variable and the ecommerce setting of the tag. |
Every search appears twice (search and view_search_results) |
Switch off Site search in the data stream's Enhanced measurement (see Setting up your Google Analytics property). |
| Purchases or other events are counted twice | An old External Script still sends Google Analytics data or loads Tag Manager. The Analytics page names the scripts it suspects in the warning An External Script may still send Google Analytics events. Turn them off (see Switching on Native analytics). |
| Very little data in Google Analytics, no users or sessions | Check that the cookie bar is on (see Cookie bar and Consent Mode v2) and that your tags in Tag Manager are published. |
To go back, turn off Native Google Analytics on the Analytics page, save, and turn your old External Scripts back on. The shop stops loading your Tag Manager container and sending Native events.
Related articles: TronShop Cookies & Consent Mode, External scripts.
HIRE AN EXPERT!
You can hire a PromoTron expert to get an expert assistance. Contact our Support Team to schedule your session and let us help you set up Google Analytics 4 and Google Tag Manager for your TronShop.
Comments
0 comments
Please sign in to leave a comment.