Google Tag Manager
Introduction
With the Analytics module you can, among other things, connect Google Analytics to your PepperShop. Google Analytics provides valuable data about your shop visitors: where they come from, which products they are interested in and at which point they abandon a purchase. These insights help you to optimise your online shop on a solid, measurable basis rather than by gut feeling.
You can choose to connect PepperShop directly to Google Analytics (see Google Analytics 4 guide) or to send events to Google Analytics via Google Tag Manager. Google Tag Manager requires more setup because events, tags and triggers are created manually, but it offers more flexibility for additional tracking such as clicks on specific buttons or other non-e-commerce interactions. Google Tag Manager is particularly worthwhile if, in addition to e-commerce tracking, other specific user behaviour is to be measured.
You can also send events directly to Google Ads via Google Tag Manager instead of via Google Analytics.
This guide explains how to configure the Analytics module and how to create the most important triggers, tags and events.
Marketing services: we are happy to support you
Does the setup sound too complex, or would you simply prefer to use your time differently? Our marketing team can set up Google Analytics for you and also advise you on other areas of SEO and SEA. Please contact marketing@glarotech.ch.
Create a Google Tag Manager account
To connect PepperShop to Google Tag Manager, you need a Google Tag Manager account.
This Google guide explains how to create one.
Create a Google Analytics account
To view the data from Google Tag Manager, you need a Google Analytics account. We refer you to this guide from Google. Read how to:
- Create an Analytics account
- Create a new Google Analytics property
- Add a data stream
The chapters “Set up data collection” and the following ones are not relevant for you.
Module configuration
How to configure the Analytics module:
- Log in to the PepperShop administration.
- Go to “Modules” → “Analytics”.
- In the “Google Analytics integration” section, fill in the following fields:
- Activation: Tick the checkbox to activate the module.
- Integration type: Select “Google Tag Manager”
- Container ID: Enter your Google Analytics measurement ID. You can find out more in this Google guide.
- E-commerce tracking: Tick the checkbox (recommended)
- Activate enhanced e-commerce reports: Tick the checkbox (recommended)
- Transmit statistics events: Tick the checkbox (recommended)
- Advanced Consent Mode: Tick the checkbox (recommended)
Set up Google Tag Manager with Google Analytics 4
To use Google Tag Manager with Google Analytics, you need to complete the following steps.
Important: In the following, we use the English terms.
Create variables
Variables are placeholders for values or data that are needed when creating tags and triggers.
This is how you create a new variable:
- In the menu on the left of the Google Tag Manager homepage, click “Variables”.
- Under “User-Defined Variables” → “New”, create a new variable.
- Give your variable a name, for example “ga4_measurement_id”.
- Now select the variable type. (Which type is described for each variable in the text below.)
- You then usually need to fill in further details. (What to enter is described for each variable in the text below.)
Google Analytics tracking ID
The Google Analytics tracking ID is needed in many places in Google Tag Manager. It therefore makes sense to store it as a variable so that it only has to be maintained once and can easily be adjusted if it changes.
| Variable name | Variable Type | Value |
|---|---|---|
| ga4_measurement_id | Constant | G-XXXXXXXXXX |
Page Location
Page Location is used to capture the current URL of the page so that you know exactly on which page a page view or event takes place.
| Variable name | Variable Type | Data Layer Variable Name | Data Layer Version |
|---|---|---|---|
| DLV - page_location | Data Layer Variable | page_location | Version 2 |
Configure the tag
The variables you created now need to be included in the tag.
- On your Google Tag Manager homepage, select “Tags” in the sidebar on the left.
- Click “New” → “Tag Configuration”.
- Select “Google Analytics”.
- Select “Google Tag”.
- Create the following tag:
- Tag Name: “GA4 - Config. + page view”
- Tag ID: Select the variable “ga4_measurement_id” here.
- Configuration Settings → Add parameter
- Configuration parameter: Enter “DLV - page_location”.
- Value: Enter {{DLV - page_location}}.
- Configuration Settings → Add parameter again
- Configuration parameter: Enter “send_page_view”.
- Value: Enter “true”.
- Finally, add a trigger to fire the tag.
- Select “All Pages” as the firing trigger.
- The tag can now be saved.
The tag then looks as follows:

E-commerce tracking
With e-commerce tracking, Google Analytics can determine information about product revenue, the average order value, the number of transactions or the number of products sold.
Create a variable
- In the menu on the left of the Google Tag Manager homepage, click “Variables”.
- Under “User-Defined Variables” → “New”, create a new variable.
- Name your variable “DLV - ecommerce.checkout.actionField.step”.
- Select the data type “Data Layer Variable”.
- Enter the following data:
| Variable name | Data Layer Variable Name | Variable Type | Data Layer Version |
|---|---|---|---|
| DLV - ecommerce.checkout.actionField.step | ecommerce.checkout.actionField.step | Data Layer Variable | Version 2 |
Create triggers
- On your Google Tag Manager homepage, select “Triggers” in the sidebar on the left.
- Create the following triggers by clicking “New”, then “Trigger Configuration”.
- Select “Custom Event”.
- Adjust the trigger name at the top left.
- Enter the event name (see the list below).
- Click “Save”.
- Repeat this for all triggers.
| Trigger Name | Trigger Type | Event Name |
|---|---|---|
| CE - view_item_list | Custom Event | view_item_list |
| CE - pps_removeFromCart | Custom Event | pps_removeFromCart |
| CE - pps_purchase | Custom Event | pps_purchase |
| CE - pps_product | Custom Event | pps_product |
| CE - pps_category | Custom Event | pps_category |
| CE - pps_addToCart | Custom Event | pps_addToCart |
| *CE - pps_checkout - begin_checkout | Custom Event | pps_checkout |
*For the “Trigger CE - pps_checkout - begin_checkout”, an additional setting is required:
- For “This trigger fires on”, select “Some Custom Events”.
- Enter the following:
- First field: Select “DLV - ecommerce.checkout.actionField.step”
- Second field: Select “equals”.
- Third field: Enter “2”.
Create tags
- On your Google Tag Manager homepage, select “Tags” in the sidebar on the left.
- Click “New” → “Tag Configuration”.
- Select “Google Analytics”.
- Select “Google Analytics: GA4 Event”.
- Fill in the following details:
- Adjust the tag name at the top left (see the table below).
- Measurement ID: Select the variable “ga4_measurement_id” here.
- Enter the event name (see the table below).
- Under “More Settings”, tick “Send Ecommerce data” and select “Data Layer” in the drop-down.
- Select the trigger (see the table below).
- Click “Save”.
- Repeat these steps until you have created all tags.
| Tag Name | Event Name | Triggering |
|---|---|---|
| GA4 - PS - add_to_cart | add_to_cart | CE - pps_addToCart |
| GA4 - PS - begin_checkout | begin_checkout | CE - pps_checkout - begin_checkout |
| GA4 - PS - purchase | purchase | CE - pps_purchase |
| GA4 - PS - remove_from_cart | remove_from_cart | CE - pps_removeFromCart |
| GA4 - PS - view_item | view_item | CE - pps_product |
| GA4 - PS - view_item_list | view_item_list | CE - pps_category |
Enhanced conversions (user_data)
If enhanced conversions is enabled in the Analytics module, the dataLayer push for the pps_purchase event also contains the user_data object (email and phone already hashed with SHA-256; optionally address).
Setup in Google Tag Manager:
- Create a Data Layer Variable, e.g. name
DLV - user_data, Data Layer Variable Name:user_data. - Create a User-Provided Data variable, type Code, data source:
{{DLV - user_data}}. - Open the GA4 event tag for the purchase (e.g.
GA4 - PS - purchase). Under Event parameters, add the parameteruser_dataand set the value to the User-Provided Data variable. (Not under User Properties.) - Verify the setup with GTM Preview and a test purchase.
Enhanced conversions must also be enabled in Google Analytics or Google Ads.
Publish the version
You can now test your configuration:
- In the workspace, click “Preview” at the top right.
- Enter the URL of your shop.
- A new window opens.
- Carry out a test purchase in your shop.
- Switch back to the old window (“Tag Assistant”).
- Click “Continue”.
- You should now see the events that were fired (for example “GA4 - PS - view_item”).
- Switch back to the Tag Manager page.
- Click “Submit” at the top right to publish your settings.
- Here you can still give your changes a version name and a description.
- Click “Publish”.
Further help
Do you have questions or need assistance? Do you have special requirements or desire a custom solution for your system? Our support team is happy to help. Support services are charged based on time and material at CHF 195.- / hour. Here is how to reach us:
- Email: support@glarotech.ch
- Phone: +41 (0)71 923 08 58
- Opening Hours: Monday – Friday I 8:00 a.m. – 12:00 p.m. I 1:30 p.m. – 5:00 p.m.
Further useful pages
- FAQ (Frequently Asked Questions)
- Modules & Functions
- Interfaces
