Standard WordPress websites | Google Tag Manager and Google Analytics 4 setup guide

Blanca Castillo
Blanca Castillo
  • Updated

Where do I find it?

SIDE PANEL > TourCMS Shop > Analytics > GA4

f98424a4-d460-4a7d-b997-9f6f208f064d.png

 

What does it mean?

In this article, we explain how to use Google Tag Manager (GTM) and a GA4 data layer.

Our WordPress plugin is fully integrated with Google Analytics and can:

  • Track website traffic and user engagement

  • Measure key e-commerce events (add to cart, begin checkout, purchase, etc.)

  • Help you understand booking behaviour and optimise marketing and sales

This guide will help you set up Google Tag Manager (GTM) and Google Analytics 4 (GA4) to track key e-commerce events:

 
 
 

Action

 

GA4 Event Name

 

When customers view tours

view_item

When they add items to cart

add_to_cart

When they remove items from cart

remove_from_cart

When they select payment method

add_payment_info

When they start checkout

begin_checkout

When they complete a booking

purchase

When they view tour lists

view_item_list

 
 
 

laptop computer What should I do?

Part 1: What you’ll need

Before starting, ensure you have the following access and resources:

  • A Google Account (Gmail or business account)

  • Access to your website (or share login with developer)

  • Someone who can add code to your website's header/footer


Part 2: Set up Google Analytics 4

Step 1: Create Analytics Account

  1. Go to https://analytics.google.com

  2. Click Create

  3. Click Create account

  4. Enter your business name

  5. Accept the terms and click Next

Step 2: Create Property

  1. Enter your property name (e.g., "Gray Line - [Your Site Name]")

  2. Select your timezone and currency

  3. Click Next

  4. Select your business category (Travel or Retail)

  5. Click Create

Step 3: Get Your Measurement ID

  1. Go to Admin (gear icon, bottom left)

  2. Click Data Streams (under Property section)

  3. Click your website

  4. Look for Measurement ID (looks like: G-XXXXXXXXXX)

  5. COPY THIS - You'll need it later

 


Part 3: Set up Google Tag Manager

Step 1: Create GTM Account

  1. Go to https://tagmanager.google.com

  2. Click Create Account

  3. Enter your business name

  4. Enter your website domain name

  5. Select Web as the platform

  6. Click Create

  7. Accept the terms

Step 2: Get Your Container ID

  • After the account is created, you'll see your Container ID (looks like: GTM-XXXXXX)

  • COPY THIS - You'll need it next

Step 3: Add Code to Your Website

Give this information to your website developer:

Two code snippets need to be added to your website:

  1. Code 1 - Add to the <head> section of your website (before closing </head> tag):

    • Note: Replace GTM-XXXXXX with your Container ID from Step 2.

  2. Code 2 - Add to the <body> section (immediately after opening <body> tag):

    • Note: Replace GTM-XXXXXX with your Container ID.

If you have access to your TourCMS website, implement this by:

  1. Login to your Wordpress backend. In case you do not have these credentials, please email support@palisis.com so we can create a user for your organisation.

  2. In the left sidebar, click on TourCMS Shop > Customisations. 

  3. Click on the tab for Custom Scripts.

  4. Paste the code snippets in the Header Script and Body Script respectively, as per the instructions above.

 

fb0cf29e-b033-43d2-af7f-4f05bd6adb8d.png
 

Part 4: Create variables in GTM

In Google Tag Manager, variables store information from your website so it can be sent to Google Analytics.

Go to GTM → Variables → Click "New" and create these 8 Data Layer Variables:

 

Variable Name

 

Type

 

Data Layer Variable Name

 

Default Value (for List Name only)

 

DL - Currency

Data Layer Variable

ecommerce.currency

 

DL - Value

Data Layer Variable

ecommerce.value

 

DL - Transaction ID

Data Layer Variable

ecommerce.transaction_id

 

DL - Payment Type

Data Layer Variable

ecommerce.payment_type

 

DL - Booking ID

Data Layer Variable

confirmed_booking_id

 

DL - Items Array

Data Layer Variable

ecommerce.items

 

DL - List Name

Data Layer Variable

ecommerce.list_name

Search Results

GA4 Measurement ID

Constant

Not Applicable

(Paste your Measurement ID from Part 2: G-XXXXXXXXXX)

 
 
 

Part 5: Create triggers in GTM

Triggers tell GTM when to send information to Google Analytics. Each event needs a trigger.

Go to GTM → Triggers → Click "New" and create these 7 Custom Event triggers:

Trigger Name

 

Trigger Type

 

Event Name (Required)

 

trigger_view_item

Custom Event

view_item

trigger_add_to_cart

Custom Event

add_to_cart

trigger_remove_from_cart

Custom Event

remove_from_cart

trigger_add_payment_info

Custom Event

add_payment_info

trigger_begin_checkout

Custom Event

begin_checkout

trigger_purchase

Custom Event

purchase

trigger_view_item_list

Custom Event

view_item_list

 
 

Part 6: Create tags in GTM

Tags send your booking data to Google Analytics.

Go to GTM → Tags → Click "New" and create the following:

1. GA4 Configuration Tag (Essential)

Setting

 

Value

 

Tag Name

GA4 - Configuration

Tag Type

Google Analytics: GA4 Configuration

Measurement ID

{{GA4 Measurement ID}} (Variable)

Trigger

Initialization - All Pages

 

2. GA4 Event Tags (7 Total)

For each event below, the Tag Configuration Type is Google Analytics: GA4 Event. The Measurement ID is always {{GA4 Measurement ID}}.

Event: view_item

Parameter

 

Value

 

Trigger

 

currency

{{DL - Currency}}

trigger_view_item

value

{{DL - Value}}

 

items

{{DL - Items Array}}

 

 
 
Event: add_to_cart

Parameter

 

Value

 

Trigger

 

currency

{{DL - Currency}}

trigger_add_to_cart

value

{{DL - Value}}

 

items

{{DL - Items Array}}

 

 
 
Event: remove_from_cart

Parameter

 

Value

 

Trigger

 

currency

{{DL - Currency}}

trigger_remove_from_cart

value

{{DL - Value}}

 

items

{{DL - Items Array}}

 

 
 
Event: add_payment_info

Parameter

 

Value

 

Trigger

 

currency

{{DL - Currency}}

trigger_add_payment_info

value

{{DL - Value}}

 

payment_type

{{DL - Payment Type}}

 

items

{{DL - Items Array}}

 

 
 
Event: begin_checkout

Parameter

 

Value

 

Trigger

 

currency

{{DL - Currency}}

trigger_begin_checkout

value

{{DL - Value}}

 

items

{{DL - Items Array}}

 

 
 
Event: purchase (MOST IMPORTANT - Tracks Revenue)

Parameter

 

Value

 

Trigger

 

transaction_id

{{DL - Transaction ID}}

trigger_purchase

currency

{{DL - Currency}}

 

value

{{DL - Value}}

 

items

{{DL - Items Array}}

 

booking_id

{{DL - Booking ID}}

 

 
 
Event: view_item_list

Parameter

 

Value

 

Trigger

 

currency

{{DL - Currency}}

trigger_view_item_list

value

{{DL - Value}}

 

items

{{DL - Items Array}}

 

list_name

{{DL - List Name}}

 

 
 

Part 7: Set up conversions in GA4

Conversions are actions that matter to your business (like a completed booking).

Go to Google Analytics 4 → Admin → Conversions → Click "Create conversion"

Conversion Name

 

Event Name

 

Notes

 

Purchase

purchase

Your main revenue conversion

Begin Checkout

begin_checkout

(Optional) Tracks drop-off rate

Add Payment Info

add_payment_info

(Optional) Tracks final step before purchase

 
 

Part 8: Testing

Before publishing, always test thoroughly to ensure accuracy.

Step 1: Preview Mode (GTM)

  1. In GTM, click Preview button (top right).

  2. Visit your website.

  3. Perform the following actions and check the Preview panel:

Action on Website

 

Expected Event in GTM Preview

 

View a tour

view_item

Add item to cart

add_to_cart

Remove item

remove_from_cart

Go to checkout

begin_checkout

Select payment

add_payment_info

Complete booking

purchase

 

Step 2: Google Analytics Real-time Report

  1. Go to Google Analytics 4 → Reports → Real-time.

  2. On your website, perform a couple of actions (e.g., view a tour and add to cart).

  3. You should see events appearing in the real-time report within 5-10 seconds.

Step 3: Check Everything

  • Are all events firing correctly?

  • Is booking revenue showing in the purchase event parameters?

  • Are there no errors in the GTM Preview console?


Part 9: Publish to Live Website

Once testing is complete and verified:

  1. In GTM, close Preview mode.

  2. Click Submit button (top right).

  3. Add a version name (e.g., "v1 - Initial Setup").

  4. Add a description of what changed.

  5. Click Publish and confirm publication.

Your website is now tracking bookings!


Part 10: Monitor & Troubleshoot

Data Availability

  • Real-time data appears within 5-10 minutes.

  • Wait 24-48 hours for full data to appear in standard GA4 reports.

Check These Reports in GA4:

  • Reports → Real-time

  • Reports → User Acquisition

  • Reports → Monetization → Conversions

  • Reports → Monetization → Revenue (confirms booking revenue)


 

Troubleshooting

 

Issue

 

Verification Check

 

No data showing

GTM code is correctly installed on the website (<head> and <body>).

Incorrect data

Verify data layer variables are populated during the event in GTM Preview.

Missing Conversions

Check GA4 Conversions list—purchase must be marked as a conversion.

Inconsistent data

Wait 48 hours for full report processing.

 
 

IMPORTANT REMINDERS

✓ The purchase event is the most critical - this tracks your revenue.

✓ Each booking must have a unique booking ID to prevent duplicate counting.

✓ Test thoroughly before publishing to the live website.

✓ Your currency must be consistent (USD, EUR, GBP, etc.).

✓ Make sure cookie consent is enabled on your website (affects tracking).


Quick reference: What gets tracked

 

Action

 

GA4 Event

 

Key Data Tracked

 

Customer views a tour

view_item

Which tour, price, category

Customer adds to cart

add_to_cart

Tour added, quantity, price

Customer removes item

remove_from_cart

What was removed

Customer selects payment

add_payment_info

Payment method chosen

Customer starts checkout

begin_checkout

Items in cart, total value

Customer completes booking

purchase

Revenue, Booking ID, Transaction ID

Customer views tour list

view_item_list

Which tours displayed, list name

 
 
 

Need help?