Skip to main content
All CollectionsWeb CheckoutManuals
How to Set up GTM and GA4
How to Set up GTM and GA4

Configure Google Tag Manager (GTM) and Google Analytics 4 (GA4) to track Ventrata's checkout events.

Lucia Burin Sestakova avatar
Written by Lucia Burin Sestakova
Updated over a month ago

❗️PLEASE NOTE that the implementation details for GTM and GA4 described in this document are accurate as of the date of publication. However, Google's systems and configurations are subject to change without notice, which may affect the functionality or behaviour of your integration. We recommend regularly reviewing Google's official documentation and staying updated on platform updates to ensure continued compatibility.❗️

Install GTM

Google Tag Manager (GTM) allows you to manage tracking scripts centrally and pass data from the data layer to tools like GA4, Google Ads, and others.

Create GTM Account

  1. Press the Create Account button.

  2. Enter your company's name in the 'Account Name' field.

  3. Select the country where your business is based.

  4. Enter your website's address in the 'Container name' field.

  5. Select the Web platform.

  6. Press the Create button.

  7. Check the box to accept Google's Data Processing Terms at the bottom of the page.

  8. Then, press the Yes button to continue.

Paste GTM Code on Website

When your account is ready, GTM will provide you with two pieces of code:

  1. Copy and paste the first snippet of code (<script>) into the <head> tag of your pages.

  2. Copy and paste the second snippet of code (<noscript>) into the opening <body> tag of your pages.

❗️IMPORTANT❗️

Make sure that you add both GTM code snippets to ALL of your pages where the Ventrata checkout is implemented.

Verify GTM Installation

  1. Open your website in any browser.

  2. Anywhere on the page, right-click and select 'Inspect', which opens the developer tools.

  3. Click anywhere inside the console, then press CTRL (Win) or COMMAND (Mac) + F on your keyboard.

  4. Type 'GTM' or the exact GTM container ID ('GTM-XXXXXXX') in the search bar and press ENTER on your keyboard.


    📗 TIP

    You can find your container ID under the Accounts tab of your Tag Manager dashboard. See below for more information.


  5. If GTM is correctly installed, you will find the container ID in the GTM code snippet.


    📗 TIP

    Alternatively, you can search for 'dataLayer' to verify that data is being sent.



Create Configuration Tag

The configuration tag is used to initialise GA4 tracking on your website. It enables GA4 to start sending data to your Google Analytics property for all subsequent events. To create one, you will need to locate your Google Tag ID and create the configuration tag in GTM.

Locate Google Tag ID

  1. Sign in to you Google Tag Manager account.

  2. Go to the Google tags tab.

  3. You will find your Google Tag IDs next to your Tag Name.

  4. Keep this page open. You will need the Tag ID in the next step.

Configure GA4 in GTM

To configure GA4 in GTM, you can use both the 'Google Analytics' and 'Google Tag' tag types. However, as Google Tag is a newer implementation and it consolidates and simplifies tag management for Google products like Google Analytics, Google Ads, etc., this example uses the 'Google Tag' tag type to create the configuration tag.

  1. In a new browser tab, open your GTM dashboard.

  2. Select your container.

  3. In the your workspace navigate to Tags.

  4. Press the New button in the top right corner of your workspace.

  5. Click on the Tag Configuration card.

  6. Select 'Google Tag' from the list of tag types.

  7. Copy and paste your 'Tag ID', starting with G-XXXXXXXX, from above.

  8. Click on the Triggering card.

  9. Select the built-in 'All Pages' trigger to ensure the tag will be fired on every page.

  10. Name your tag so that it is clear this is the configuration tag.

  11. Then, press the Save button.


GTM Tags, Triggers and Variables

Setting up Tags, Triggers, and Variables in Google Tag Manager (GTM) is a crucial step in the configuration process. Without this setup, Google Analytics 4 (GA4) will not receive any data, even if GTM is properly installed, your GA4 account is configured, and Ventrata has a fully functional Data Layer implementation in place.

Add Triggers

Create triggers that will fire the respective tags based on user interactions or events on your website.

  1. In your GTM dashboard, navigate to Triggers.

  2. Press the New button in the top right corner of your workspace.

  3. Click on the Trigger Configuration card.

  4. Select the appropriate trigger type from the list of options.

  5. Enter the name of the event based on which the trigger will fire the corresponding tag.

  6. You can use the same event name to name the trigger.

  7. Press the Save button.

Add Event Tags

Create tags for each event you want to track (View Item, Custom Event, Add To Cart, View Cart, Begin Checkout, Add Payment Info, Purchase). For each tag, set the 'Event Name' and any additional 'Event Parameters' required.

📗 TIP

Find the list of events supported by Ventrata in the Tracking Manual.

Locate GA4 Measurement ID

  1. Sign in to your Google Analytics account.

  2. Press the settings button to access admin and account settings.

  3. Go to Data streams and select the desired data stream, or website.

  4. On the stream details, note the stream's measurement ID. You will need it in the next step.

Add Event Tags

  1. In your GTM workspace, go to Tags.

  2. Press the New button in the top right corner of your workspace.

  3. Click on the Tag Configuration card.

  4. Select 'Google Analytics' from the list of tag types.

  5. Then, select 'Google Analytics: GA4 Event'.

  6. Copy and paste your Google Analytics 'Measurement ID' from above.

  7. Add the name of the event you want to track.

  8. Expand the More Settings section and check the 'Send Ecommerce data' box.

  9. Keep the preselected data source on 'Data Layer'.

  10. Expand the Event Parameters section.

  11. Press the Add parameter button to create a variable for the particular parameter inside the event.


    📗 TIP

    Find the list of supported event parameters in the Tracking Manual.


  12. Enter the name of the parameter in the 'Event parameter' field.

  13. Then, press the building blockicon in the 'Value' field.

  14. Press the + sign in the top right corner of the screen to add a new variable.

  15. Click on the Variable Configuration card.

  16. Select the 'Data Layer Variable' option from the list of variable types.

  17. Enter the variable name.


    📗 TIP

    Follow the established naming conventions for variables. Use hierarchical structure where higher- and lower-level elements are separated by a colon ( . ). For example, ecommerce.extras indicates that the "eccommerce" parameter is the parent of the "extras" event parameter. Refer to the Event Tracking Implementation section of the Tracking Manual to verify the correct structure for event bodies.


  18. Name your variable.

  19. Then, press the Save button.

  20. Repeat steps 9. to 18. for each event parameter.

Add Triggers

  1. Click on the Triggering card on the event tag detail.

  2. Create a new trigger using the + icon in the top right corner or select an existing trigger from the list.

  3. Then, name your event tag to represent the event you will track.

  4. Press the Save button to save your changes.

You will now have at least two tags set up:

  • a configuration tag to initialise GA4 tracking on your website, and

  • an event tag to track specific user interactions.

You can continue adding as many event tags as you need to collect precise data on customer behaviour across your website.


Publish GTM Configuration

When all your relevant tags, triggers and variables are configured,

  1. Press the Submit button on the ribbon.

  2. Enter a version name and a description.

  3. Finally, press the Publish button in the top right corner.

  4. After successfully publishing your changes, events will be captured in GA4 immediately, which you can verify in your GA4 account.

Did this answer your question?