Skip to main content

Google Analytics 4 gtag documentation

· 8 min read
Pavel Husa

List of Events​

List of events sent to Shoptet during the implementation of Google Analytics 4:
• page_view
• generate_lead
• login
• sign_up
• search
• view_item_list
• view_item
• add_to_cart
• remove_from_cart
• view_cart
• begin_checkout
• add_shipping_info
• add_payment_info
• checkout_progress
• purchase

page_view Event​

The event is triggered upon script loading. Along with the ‘page_view’ event, additional information about the loaded page is also sent.

ParameterValueNotes
content_grouphomepage/category/…Refer to the content_group code list
groups/send_toGA4This specifies the data to be sent and is a technical parameter at the gtag library level.
currencyCZKCurrency Enforcement.
page_languagecsLanguage Regulation.
user_idbf0019fe-03a3-11ee-af0f-d216876cc7a6User Identification.
traffic_typeinternalDifferentiating Logged-In Administrators

Items Object​

A unified ‘items’ object is used for events and is automatically processed within Google Analytics 4

ParameterExampleDescription
item_id​774323Item Id.
item_name​ABC bookItem Name.
item_brand​New publishing houseBrand.
item_category​The Toy StoreThe category tree can have up to five levels, based on the product’s primary classification.
item_category2​Kids’ books
item_category3​From 6 years old
item_category4​Illustrated
item_category5​Short
item_list_id​Refer to CodelistProduct List ID.
item_list_name​Refer to CodelistName of the Product List.
item_variant​DS888980183~Variant: 6-12 m – pink/6-12 mID~Verbal Label Based on Item Variant.
price​201.00Price Excluding VAT.
quantity​1Product Quantity.
index​0Product Order in Listing (Key for ‘view_item_list’ event; starts at 0 for the first product)
couponTESTCOUPON~Discount coupon No. TESTCOUPON – Discount 10%For ‘purchase’ events, the same coupon is applied at both the transaction and product levels.

item_list_id, item_list_name Codelist​

Codelist for parameters with standardized values.

Category / ModuleItem_list_nameItem_list_id
Top 10 productstop10top10
Top Sellerscategory_best_sellers: /kitchenCategory ID
Regular Categorycategory: /kitchen/Category ID
Brand Listingbrand: XXXCategory ID
Search resultssearch: standardized expressionalways 999999
Popup with productsrelated_popup: popup IDpopup ID

Content_group Codelist​

The codelist corresponds to the values that are passed within the data layer in the shoptet.page.Type variable.

Page TypeContent_groupComment
Article detail.articleArticle detail.
List of products in category.categoryList of products in category.
Product detail.productDetailProduct detail.
Homepage.homepageHomepage.
Thank you page.thankYouThank you page.
Cart steps.cartCart steps.
Blog categories.sectionBlog categories.
Cart step shipping and payment.billingAndShippingCart step shipping and payment.
Cart step customer details.customerDetailsCart step customer details.
Thank you page (order confirmation).thankYouThank you page (order confirmation).

view_item Event​

It’s triggered upon loading the product detail page, also known as the product card. If the product has multiple variants, an initial ‘view_item’ event is sent with an empty ‘item_variant’ field. Then, upon selecting a variant, another ‘view_item’ event is sent with the selected variant filled in.

ParameterValueNotes
currencyCZKCurrency Enforcement.
value123Can be used for a conversion event.
itemsStandardized ObjectUniform handling of products. In the case of the ‘view_item’ event, the number is 1.

view_cart​ Event​

The event is triggered upon entering the /kosik/ page. If a coupon has been entered from a previous cart visit, it will be displayed here.

ParameterValueNotes
currency​CZKCurrency Enforcement.
value​10.00Can be used for a conversion event.
items​Standardized objectUnified work with products.
coupon​86330287~Discount coupon No. 86330287 – 10% Discount. Redeemed Coupon. This is included if the user returns to an already initiated checkout where the coupon is already active.

begin_checkout​ Event​

The event is triggered upon entering the /order/step-1/ page. If a coupon has been entered from a previous cart visit, it will be displayed here.

ParameterValueNotes
currency​CZKCurrency Enforcement.
value​10.00Can be used for a conversion event.
items​Standardized objectUnified work with products.
coupon​86330287~Discount coupon No. 86330287 – 10% Discount. Redeemed Coupon. This is included if the user returns to an already initiated checkout where the coupon is already active.

add_shipping_info Event​

It’s sent during the second step of the cart process (on the /step-2/ page) when default values have already been selected. By examining individual events, you can evaluate the popularity of different shipping options and compare them to the actual shipping methods chosen for purchases (for example, many may initially select “Balíkovna,” but most end up choosing „Zásilkovna”).

ParameterValueNotes
currency​CZKCurrency Enforcement.
value​10.00Can be used for a conversion event.
items​Standardized objectUnified work with products.
coupon​86330287~Discount coupon No. 86330287 – 10% Discount. Redeemed Coupon.
shipping_tier​glsCz~GLS – CZType of transport (id~name).

add_payment_info​ Event​

It’s sent during the second step of the cart process (on the /step-2/ page) when default values have already been selected. By examining individual events, you can evaluate the popularity of different payment methods and compare them to the actual payment methods chosen for purchases (for example, many may initially select “cash on delivery,” but most end up paying via “ShoptetPay”

ParameterValueNotes
currency​CZKCurrency Enforcement.
value​10.00Can be used for a conversion event.
items​Standardized objectUnified work with products.
coupon​86330287~Discount coupon No. 86330287 – 10% Discount. Redeemed Coupon.
payment_type​cashOnDelivery~Cash on Delivery (GLS)​Payment type id~name

checkout_progress​ Event​

Follows on from add_shipping_info and add_payment_info. It includes both the shipping and payment types simultaneously, so you can perform an analysis from a single variable within Google Analytics 4.

ParameterValueNotes
currency​CZKCurrency Enforcement.
value​10.00Can be used for a conversion event.
items​Standardized objectUnified work with products.
coupon​86330287~Discount coupon No. 86330287 – 10% Discount. Redeemed Coupon.
payment_type​cashOnDelivery~Cash on Delivery (GLS)​Payment type id~name
shipping_tier​glsCz~GLS – CZType of transport (id~name).

view_item_list​ Event​

It offers the capability to work with impression data, serving as a valuable resource for both product sorting and monitoring product rankings across various categories.

ParameterValueNotes
currency​CZKCurrency Enforcement.
value​10.00Can be used for a conversion event.
items​Standardized objectUnified work with products.
item_list_id​Refer to CodelistProduct List ID.
Item_list_name​Refer to CodelistName of the Product List.

generate_lead​ Event​

No additional parameters. Newsletter subscriptions through native integration.

login Event​

When logging in, the ‘login’ event is triggered and the user is simultaneously identified via their user_id.

ParameterValueNotes
method​googleLogin method.

sign_up Event​

Upon registration, the ‘sign_up’ event is triggered, and identification is carried out via the user_id at the same time.

ParameterValueNotes
method​facebookLogin method.

search Event​

When using the native search feature and opening it on a new page (not yet implemented for the autocomplete feature), a ‘search’ event is sent along with the standardized search term.

ParameterValueNotes
search_term​shoesStandardized search term (diacritics removed and letters converted to lowercase).

purchase​ Event​

Occurs when an order is submitted.

ParameterValueNotes
transaction_id2023000033Transaction ID the same as in administration.
currency​CZK​Enforced currency of the transaction.
value​201.65Can be utilized for a conversion event. This refers to the purchase amount, excluding both tax and shipping fees.
tax42.35Tax value (encompasses both product and shipping taxes). This aligns with the details listed under the ‘Total Tax Line’ in the admin panel.
shipping8.26Cost of shipping, VAT excluded. Consistent with the admin panel under ‘Shipping Excluding VAT.
payment_typecash~cashPayment type in the format ID~Translation in the specified language.
shipping_tierpersonal-collection~personal collectionShipping method in the format ID~Translation in the specified language.
items​Standardized objectUnified work with products.
coupon​86330287~Discount coupon No. 86330287 – 10% Discount. Redeemed Coupon.
transaction_typeB2B/B2CTransaction Type.

view_promotion​ and select_promotion​ Event​

Not currently implemented.

consents default​​

ParameterValueNotes
analytics_storage​denied/granted
ad_storage​denied/granted
ad_personalization​denied/granted
ad_user_data​denied/granted
wait_for_update​500Shoptet default value for visits without consent

consents update​

The update_consent event is triggered within the data layer, allowing for the subsequent firing of events for additional tags at the GTM level.

ParameterValueNotes
analytics_storage​denied/granted
ad_storage​denied/granted
ad_personalization​denied/granted
ad_user_data​denied/granted

Server-Side Integration (Premium Feature)​

For clients with a premium plan, we support data transfer to Server-Side Google Tag Manager (SS GTM). This feature provides enhanced data security and greater control over data processing.

We implement this configuration using the server_container_url parameter as shown below:

gtag('config', 'TAG_ID', {
'server_container_url': 'https://analytics.example.com',
});