Skip to main content

Setting Up GA4 Ecommerce Tracking on Your CraftedStays Site

How to connect Google Analytics 4 to your CraftedStays site — either directly with a Measurement ID, or through Google Tag Manager for advanced setups.

Written by Gil Chan

CraftedStays automatically fires GA4 ecommerce events throughout the booking funnel — no custom JavaScript needed. All you need to do is connect your GA4 property to your site. There are two ways to do this: directly with a Measurement ID, or through Google Tag Manager (GTM) if you already use GTM for other tracking.

Pick one method only. If you enter a GA4 Measurement ID in CraftedStays and configure a GA4 Event tag in GTM for the same property, every event will be counted twice.


Events Tracked Automatically

CraftedStays fires these standard GA4 ecommerce events across the booking funnel:

Event

When it fires

view_item

Guest loads a property page

add_to_cart

Guest selects available dates on a property

begin_checkout

Guest reaches the checkout page

add_payment_info

Guest enters payment details

purchase

Booking is confirmed

Each event includes travel-specific custom parameters you can register as GA4 custom dimensions: check_in_date, check_out_date, nights, num_adults, num_children, num_pets, bedrooms, max_guests, property_type, city, region, country, and channel.


Option 1: Native GA4 Setup (Measurement ID)

The simplest option. Events are sent directly to your GA4 property from CraftedStays — no GTM required.

Step 1: Find your GA4 Measurement ID

  1. Open Admin > Data Streams > your web stream

  2. Copy the Measurement ID — it starts with G-

Step 2: Add it to CraftedStays

  1. In your CraftedStays dashboard, go to Site > Analytics

  2. Paste the Measurement ID into the GA4 Measurement ID field

  3. Save your changes

Step 3: Verify

  1. Open your site in a browser and visit a property page

  2. In GA4, go to Reports > Realtime

  3. You should see a view_item event appear within a few seconds

To see ecommerce data, go to Reports > Monetisation > Ecommerce purchases.


Option 2: GA4 via Google Tag Manager

Use this method if you already have a GTM container on your site and want all tracking to flow through GTM. This lets you add custom event parameters, build audiences, and control firing conditions from GTM without touching CraftedStays settings.

Step 1: Connect your GTM container in CraftedStays

  1. In your CraftedStays dashboard, go to Site > Analytics

  2. Enter your GTM Container ID (format: GTM-XXXXXXX) in the GTM Container ID field

  3. Save — leave the GA4 Measurement ID field empty

Quick start: Import the pre-built template

Instead of building the trigger and tag by hand, you can import our pre-built container snippet. It adds the CE - CS Ecommerce Events trigger and the GA4 Ecommerce Events tag to your existing container in one step — your other tags are untouched.

  1. Copy the JSON below

  2. Save it as a .json file on your computer (e.g. craftedstays-gtm.json)

  3. In GTM, go to Admin > Import Container

  4. Choose the file, select Merge (not Overwrite), and click Confirm

  5. Open the imported GA4 Ecommerce Events tag, replace G-XXXXXXXXXX with your GA4 Measurement ID, and save

  6. Click Submit to publish

{
  "exportFormatVersion": 2,
  "exportTime": "2026-05-22 18:00:00",
  "containerVersion": {
    "path": "accounts/0/containers/0/versions/0",
    "accountId": "0",
    "containerId": "0",
    "containerVersionId": "0",
    "container": {
      "path": "accounts/0/containers/0",
      "accountId": "0",
      "containerId": "0",
      "name": "CraftedStays Ecommerce Starter",
      "publicId": "GTM-XXXXXXX",
      "usageContext": ["WEB"]
    },
    "builtInVariable": [
      {
        "accountId": "0",
        "containerId": "0",
        "type": "EVENT",
        "name": "Event"
      }
    ],
    "trigger": [
      {
        "accountId": "0",
        "containerId": "0",
        "triggerId": "1",
        "name": "CE - CS Ecommerce Events",
        "type": "CUSTOM_EVENT",
        "customEventFilter": [
          {
            "type": "MATCH_REGEX",
            "parameter": [
              {
                "type": "TEMPLATE",
                "key": "arg0",
                "value": "{{_event}}"
              },
              {
                "type": "TEMPLATE",
                "key": "arg1",
                "value": "view_item|add_to_cart|begin_checkout|add_payment_info|purchase"
              }
            ]
          }
        ],
        "fingerprint": "1748000000000"
      }
    ],
    "tag": [
      {
        "accountId": "0",
        "containerId": "0",
        "tagId": "1",
        "name": "GA4 Ecommerce Events",
        "type": "gaawe",
        "parameter": [
          {
            "type": "TEMPLATE",
            "key": "measurementIdOverride",
            "value": "G-XXXXXXXXXX"
          },
          {
            "type": "TEMPLATE",
            "key": "eventName",
            "value": "{{Event}}"
          },
          {
            "type": "BOOLEAN",
            "key": "sendEcommerceData",
            "value": "true"
          },
          {
            "type": "TEMPLATE",
            "key": "ecommerceMacroData",
            "value": "dataLayer"
          }
        ],
        "firingTriggerId": ["1"],
        "fingerprint": "1748000000001",
        "tagFiringOption": "NOT_ONCE_PER_EVENT"
      }
    ],
    "fingerprint": "1748000000002"
  }
}

Or set it up manually

Step 2: Enable the Event built-in variable in GTM

CraftedStays pushes events to the dataLayer using the key event (e.g. view_item, begin_checkout). GTM needs the built-in {{Event}} variable enabled to read it.

  1. In GTM, go to Variables > Configure

  2. Under Events, check the box for Event

  3. Click Save

Step 3: Create a Custom Event trigger

  1. Go to Triggers > New

  2. Set Trigger Type to Custom Event

  3. In the Event name field, enter:
    view_item|add_to_cart|begin_checkout|add_payment_info|purchase

  4. Check Use regex matching

  5. Name the trigger (e.g. CS Ecommerce Events) and save

Step 4: Create the GA4 Event tag

  1. Go to Tags > New

  2. Set Tag Type to Google Analytics: GA4 Event

  3. For Configuration Tag, select your existing GA4 Configuration tag (or choose None — Manually Set ID and enter your G- Measurement ID)

  4. Set Event Name to {{Event}}

  5. Expand More Settings > Ecommerce

  6. Enable Send Ecommerce data and set Data source to Data Layer

  7. Under Triggering, select the trigger you created in Step 3

  8. Name the tag (e.g. GA4 Ecommerce Events) and save

Step 5: Test and publish

  1. Click Preview in GTM and open your site

  2. Visit a property page — the CS Ecommerce Events trigger should fire and the GA4 Ecommerce Events tag should appear as fired

  3. Confirm in GA4 Realtime or DebugView that events are arriving

  4. Back in GTM, click Submit to publish your container version


Troubleshooting

Events not showing in GA4

  • Check GA4 Realtime — new properties can take 24–48 hours to process historical data

  • Use GA4 DebugView (Admin > DebugView) for immediate event inspection

  • For the GTM path: confirm the container is published (not just saved as a draft) and the {{Event}} variable is enabled

Duplicate events in GA4 (GTM path only)

If you see every event counted twice, you have both a GA4 Measurement ID entered in CraftedStays admin and a GTM GA4 Event tag set up. Remove one — either clear the Measurement ID in CraftedStays admin, or delete the GTM GA4 Event tag.

Ecommerce data missing from events

In your GTM GA4 Event tag, confirm that Send Ecommerce data is enabled and the data source is set to Data Layer (not Google Analytics). CraftedStays uses the standard dataLayer ecommerce format.

Did this answer your question?