Google Tag Manager (GTM)

In this article, you'll learn what you need to know about using Google Tag Manager (GTM) with e-guma.

Linking Google Tag Manager with e-guma

You can link your Google Tag Manager account with e-guma. In e-guma select Settings -> Online shop -> Basic settings. Activate the field Google Tag Manager and enter your Container-ID. All Google Tag Manager Container-ID start with GTM-.

In this article by Google, you'll learn where to find your Container-ID in your Google Tag Manager account. Once you have linked e-guma with your Google Tag Manager, you can start adding tags in Google Tag Manager.

You can enter both the Google Analytics Measurement-ID and the Container-ID from Google Tag Manager. However, when using Google Tag Manager, we recommend that you integrate Google Analytics into Google Tag Manager and only enter the Container-ID from Google Tag Manager into your e-guma Backoffice. If you enter both IDs in e-guma, Google Analytics must not be integrated in the Tag Manager. This would otherwise lead to double counting. More information on Google Analytics you will find here.

Set up a GA4 tag

To be able to measure the number of visitors to your online shop in Google Analytics via the Google Tag Manager, make the following settings. 
Create a new tag in Google Tag Manager and select the type Google Analytics - GA4 configuration or Google Tag in the tag configuration.
Add your GA4 measurement ID in the corresponding field. 

In the Triggers area, add a trigger of the Page Views type and activate All Page Views.  

When Google Tag Manager is integrated into e-guma, Google's standard code snippet for page views is included on every page.

E-Commerce-Tracking

The data in the e-commerce section of Google Analytics can be delayed by a few hours up to days. More info

It is also possible to record the vouchers/ticket/product sales in your online shop. Before you can use this function, you have to set up a according tag in Google Tag Manager.

Create a new tag in Google Tag Manager and select the type Google Analytics: GA4 event in the tag configuration
Add your GA4 measurement ID in the corresponding field. Use the integrated variable {{Event}} as the event name. 

Activate the option Send e-commerce data under Additional settings > E-Commerce. Use DataLayer as the data source. 

In the Trigger area, add a trigger of the Custom event type and use the following event name

^(view_item|view_item_list|select_item|add_to_cart|remove_from_cart|view_cart|begin_checkout|add_payment_info|add_shipping_info|purchase)$

On the completion page, we save the order data in the DataLayer. Below is an example:
<script type="text/plain" data-cookiecategory="analytics">  
dataLayer = [];     
 
	dataLayer.push({            
		'event': 'purchase',            
		'ecommerce': {                
			'transaction_id': 'VOUCHER G10004',                
			'affiliation' : 'e-guma',                
			'value': 20,                
			'currency': 'CHF',                
			'items': [
					{  
					'item_name': 'Wertgutschein (Gutschein)',  
					'item_id': '35f5d3ef-c6ab-43fc-9931-4ba7843dd938',
					'price': 20,                            
					'item_category': 'Gutschein',                            
					'quantity': 1,                          ยจ
					}               
			]           
		}      
	});
</script>           			]            		}       	}); </script>
	

More details can be found in the Google Tag Manager user guide on e-commerce information.

Restrictions

Please note the following restrictions for e-commerce tracking:

  • For now, only the purchase event is supported by e-guma and is triggered out in the data layer.
  • Other events such as view_item_list, view_item, add_to_cart, view_cart are not yet integrated. Implementation is planned.
  • If needed, you can manually add other events in the Google Tag Manager. 

No data will be sent to Google Analytics during the project phase. (The project phase ends upon go live),