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
- Log in to Booker / Mindbody admin
- Go to System Settings → Online Booking
- Under Appointments, click the edit (pencil) icon
- Scroll to Analytics
- Select Google Tag Manager
- Paste your GTM Container ID (example: GTM-XXXXXXX)
- 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
- Click Submit
- Add a version name
- 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:
- Go to Reports → Monetization → Ecommerce Purchases
- 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.