How to set up Google Tag Manager

Google Tag Manager (GTM) is a third-party service that you can connect to Mews Operations to allow you to track traffic and clicks in the Mews Booking Engine and generate reports in Google Analytics. You need to create accounts for your property in Google Tag Manager and Google Analytics 4, then connect them with your booking engine to begin creating triggers and tags to help you report and gather data from your Mews Booking Engine. 

This article details the initial setup and connecting Google Tag Manager to Mews Operations,

Note:  

  • Before you start make sure you disable your Adblocker so that you can see all the necessary page elements. 
  • Chain enterprises can track only one tag in a chain distributor.  
  • To use the tag for multiple properties, use the filtering function in Google Tag Manager to filter properties by name. Filtering allows you to see when the tag was used for each property. 
 
 

In this article you can learn how to set up Google Tag Manager: 



Step 1: Create your Google Tag Manager account

To create your Google Tag Manager account, you need to have a Google account. If you do not already have a Google account for your property, you can create one for free
  1. Log in to Google Tag Manager with your property's Google account credentials. 
  2. Click Create Account. This opens the Google Tag Manager account settings page. 
Google account creation
  1. In the Account setup screen, enter your property's details. 
  2. In the Container setup screen, complete the following fields: 
  • Container name: Enter your property’s name. 
  • Target platform: Select Web
  1. Click Create
  2. Accept the terms of service, then click Yes
  3. Note down your Google Tag Manager IDNote: You need this to connect Google Tag Manager to Mews Operations. 
 

Step 2: Connect your account with Mews Operations

  1. In Mews Operations, go to the main menu Menu arrow right   > Settings > Services
  2. Select a Bookable service. 
  3. Click on Booking engines
  4. Select the booking engine that you want to track with Google Tag Manager. 
  5. Under Google tag manager ID, enter the ID that you noted in Step 1
  6. Click Save
 

Step 3: Create your Google Analytics account

  1. Log in to Google Analytics with your property's Google account credentials. Note: You need to use the same account that you used to create your Google Tag Manager account.  
  2. Fill in the following details: 
  • Account name: Enter your property’s name, then click Next
  • Property name: Enter your property’s name.  
  • Reporting time zone: Select the time zone for the location you intend to track. 
  • Currency: Select the currency for the location you intend to track. Click Next
  • Industry category: Select Travel. 
  • Business size: Select the appropriate size for your business.  
  1. Check relevant boxes for how you intend to use Google Analytics, then click Create
  2. In the new screen, fill in the following details: 
  • Choose a platform: Select Web.  
  • Website URL: Enter the booking engine URL. Note: If you copy the URL, make sure you delete 'https://' from the beginning otherwise you get an error. 
  • Stream name: Enter your property’s name. 
  • Use the slider switch to choose Enhanced measurement
  1. Click Create Stream
  2. In the new Web stream details window, note the Measurement ID in the top right corner. You need it to create your tags later.

 

 

Create your triggers

You can use triggers to choose events to activate the Google Analytics tracking in the booking engine. Mews recommends that you create a catch-all trigger that activates tracking whenever there is an occurrence in the booking engine. This way, you do not need to set up or manage triggers for multiple events. To set up triggers for specific events, refer to this list of events.

To create your trigger:  

  1. Open Google Tag Manager and click your account.
  2. Click Triggers and then click New.  
  3. Rename "Untitled trigger" as "All GA4 Events". Note: If you are creating a trigger for a more specific event, choose an appropriate name.
  4. Click Trigger configuration > Custom event.
    1. Under Event name, enter “^ga4”. Note: If you are creating a trigger for a more specific event, choose from this list of custom trigger events.
    2. Check the Use regex matching box.
    3. Click This trigger fires on All Custom Events. 
  5. Click Save

 

Create your tags

You can use tags to allow Google Analytics to track user behavior in the Mews Booking Engine. The tags collect information on events such as clicks, page views and more so Google Analytics can analyze them.
 

To set up Google Analytics 4

Create variables 

  1. Open Google Tag Manager > Variables.
  2. Under User-defined Variables, click New.  
    1. Rename "Untitled variable" as "GA4 Event name".
    2. Click Variable configuration > Data layer variable.
    3. For Data layer variable name, enter "eventName" and click Save.
  3. Under User-defined Variables, click New.
    • Rename "Untitled variable" as "GA4 Pageview location".
    • Click Variable configuration > Data layer variable.
    • For Data layer variable name, enter "page_location" and click Save.  
  4. Under User-defined Variables, click New.
    • Rename "Untitled variable" as "GA4 Pageview title".
    • Click Variable configuration > Data layer variable.
    • For Data layer variable name, enter "page_title" and click Save.  

Create the tag

  1. Open Google Tag Manager Tags > New.
  2. Rename "Untitled tag" as "Google Analytics 4".
  3. Click Tag configuration Google Analytics > Google Analytics: GA4 Event.
    1. Under Measurement ID, enter the Measurement ID you noted when in Step 3 when creating your Google Analytics account.
    2. Under Event Name, click Add variable  > GA4 Event name.
    3. Under User Properties, click Add row. Fill in the following details:
      • Property Name: Enter “Page Title”.
      • Value: Enter “{{GA4 Pageview title}}” or select the correct variable after clicking Add variable
    4. Click Add Row. Fill in the following details:
      • Field Name: Enter "Page Location”.
      • Value: Enter “{{GA4 Pageview location}}” or select the correct variable after clicking Add variable 
  4. Click Triggering > All GA4 Events.
  5. Click Save

 

To set up Google E-Commerce

Create the trigger

  1. Open Google Tag Manager > Trigger > New.
  2. Rename “Untitled Tag” as “All GA4 e-Commerce Events”. Note: If you are creating a trigger for a specific event, choose an appropriate name.
  3. Click Trigger Configuration > Custom Event.
    1. Under Event name, enter the event name, for example, “^view_item_list|^view_item|^select_promotion|^add_to_cart|^remove_from_cart|^begin_checkout|^add_payment_info|^purchase.” Note: If you are creating a trigger for a more specific event, choose from this list of custom trigger events. 
    2. Check the Use regex matching box.
    3. Click This trigger fires on All Custom Events. 
  4. Click Save

Create the tag

  1. Open Google Tag Manager > Tags New.
  2. Rename "Untitled Tag" as "E-Commerce GA4".
  3. Click Tag Configuration > Google Analytics > Google Analytics: GA4 Event.
    1. Under Measurement ID, enter the Measurement ID you noted in Step 3 when creating your Google Analytics account. 
    2. Under Event Name, click Add variable  Event.   
    3. Under More Settings, check the Send Ecommerce data box.
    4. Under Data source, click Data Layer.   
  4. Click Triggering > All GA4 e-Commerce Events
  5. Click Save.   


Note:

  • You can monitor GA4 Events from the Google Analytics real-time dashboard.
  • E-commerce events take 24 hours to show revenue amounts.

 

Step 4: Test your Google Tag Manager setup 

Before you start collecting data, test your setup to ensure that: 

  • Mews and Google Tag Manager are connected. 
  • The triggers fire correctly. 
  • The tags send data correctly to Google Analytics 4.  

 

Enable preview mode in Google Tag Manager 

  1. Open Google Tag Manager.  
  2. Click Preview
  3. In the tag assistant, enter your Booking Engine URL if not already populated. 
  4. Click Connect.  Note: If a new screen does not open, make sure to allow "pop-ups" for Google Tag Manager within your browser settings. 
  5. Locate the Tag Assistant pop-up, then ensure that you include gtm_debug in the URL. 
  6. Go back to the Google Tag Manager tab, then click Continue.   

Test events with Google Analytics 4 debug view 

  1. Enable the preview window in Google Tag Manager
  2. In a new window, open Google AnalyticsAdmin.
  3. In Data display, click DebugView. 
  4. Click _Debug Device_ and make a selection.  Note: Select 'No Devices Available' if this is the only option available. 

 

You can now view all tracked events in real time.  


You can learn more about the Google Tag Manager console here

Was this article helpful?
10



Feedback