GA4 Purchase Tracking via GTM for Booker (Mindbody)

This guide explains how to set up GA4 purchase tracking using Google Tag Manager (GTM) for the Booker (Mindbody) online booking platform. It also includes a simple method to track purchases by location.


1. Connect Google Tag Manager in Booker

  1. Log in to Booker / Mindbody admin
  2. Go to System Settings → Online Booking
  3. Under Appointments, click the edit (pencil) icon
  4. Scroll to Analytics
  5. Select Google Tag Manager
  6. Paste your GTM Container ID (example: GTM-XXXXXXX)
  7. Click Save

This ensures Booker sends booking data into GTM.


2. Create Data Layer Variables in GTM

Go to GTM → Variables → New

Cart Order ID

  • Name: DLV – Cart Order ID
  • Type: Data Layer Variable
  • Data Layer Variable Name: ecommerce.purchase.actionField.id

Revenue

  • Name: DLV – Revenue
  • Type: Data Layer Variable
  • Data Layer Variable Name: ecommerce.purchase.actionField.revenue

3. Create Purchase Trigger

Go to GTM → Triggers → New

  • Name: Trigger – onlineBookingPurchase
  • Type: Custom Event
  • Event Name: onlineBookingPurchase
  • Fires On: All Custom Events

This trigger fires when a booking is successfully completed.


4. Create GA4 Purchase Tag

Go to GTM → Tags → New

Tag Setup

  • Tag Type: GA4 Event
  • Event Name: purchase
  • Configuration Tag: Select your GA4 configuration tag

Event Parameters

  • transaction_id: {{DLV – Cart Order ID}}
  • value: {{DLV – Revenue}}
  • currency: USD (change if needed)

Trigger

  • Trigger: Trigger – onlineBookingPurchase

5. Location Tracking (Multi-Location Setup)

If your Booker account has multiple locations, you can track which location generated the booking using the page URL.

Method Used

This implementation uses a Regex Table variable in GTM to extract the location from the URL.

Requirement for This Method

  • The booking URLs must contain a unique location identifier (slug)
  • Example structure:

/location/new-york/…

If your URLs follow this pattern, this method will work reliably.


5.1 Create Location Variable

Go to GTM → Variables → New

  • Name: Regex – Location Name
  • Type: Regex Table
  • Input Variable: Page Path

5.2 Configure Mapping

  • Input: .*new-york.* → Output: New York
  • Input: .*texas.* → Output: Texas

Replace new-your and texas with your actual URL slugs.

5.3 Default Value

  • Default Value: Unknown Location

5.4 Add Location to Purchase Tag

Open your GA4 Purchase Tag and add:

  • Parameter Name: affiliation
  • Value: {{Regex – Location Name}}

Note: “affiliation” is a standard GA4 field used for store or branch tracking.


6. Publish GTM

  1. Click Submit
  2. Add a version name
  3. Click Publish

7. Testing

Using GTM Preview

  • Enable Preview mode
  • Open the booking site
  • Navigate through the booking flow

Validate Variables

  • Location variable returns correct location
  • Order ID is not empty
  • Revenue shows correct value

Validate Event

  • Event: onlineBookingPurchase
  • Tag fired: GA4 Purchase Event

Check in GA4

  • Go to Realtime report
  • Confirm purchase event is received

8. Reporting in GA4

To analyze performance by location:

  1. Go to Reports → Monetization → Ecommerce Purchases
  2. Add secondary dimension: affiliation

You can now compare revenue and purchases by location.


Conclusion

This setup enables accurate GA4 purchase tracking for Booker using GTM, including multi-location attribution. It works without modifying the Booker platform and relies on URL-based identification, making it scalable and easy to implement.