# Connect Online Booking to Facebook or Google Analytics

> Connect your Online Booking pages to a Facebook Pixel or Google Analytics 4 tag and learn which events ServiceM8 sends.

If you have Self-Serve Online Booking pages set up through the [Services add-on](/help-center/servicem8-add-ons/services-online-booking/introduction-to-the-services-add-on), you can connect a Facebook Pixel or Google Analytics 4 property to measure visits, checkout activity, and conversions.

## Add a tracking ID

1. In the Online Dashboard, go to **Settings** > **Self Serve Online Booking**.
2. Under **Track Advertising**, enter one or both of the following:
   - **Facebook Pixel ID**: your numeric Facebook Pixel ID.
   - **Google Analytics Tracking ID**: a Google Analytics 4 Measurement ID beginning with `G-`, or a Google tag ID beginning with `GT-`.
3. Click **Save**.

Enter the tracking ID itself. You do not need to paste a complete HTML `<script>` snippet.

[![](https://s3.amazonaws.com/screensteps_live/image_assets/assets/001/922/924/medium/Screen_Shot_2018-09-18_at_12.06.04_pm.png?1537239089)](https://s3.amazonaws.com/screensteps_live/image_assets/assets/001/922/924/original/Screen_Shot_2018-09-18_at_12.06.04_pm.png?1537239089)

## Facebook Pixel events

ServiceM8 sends a Facebook Pixel event when your client views a Service, reaches checkout, completes a priced booking, or submits a booking or enquiry without a price.

## Google Analytics 4 ecommerce events

ServiceM8 sends these Google Analytics 4 ecommerce events from your Online Booking pages:

| Client action | Google Analytics event | Ecommerce data |
| --- | --- | --- |
| Views a Service | `view_item` | Service ID and name, quantity, and the value, currency, and item price when a price is known |
| Reaches checkout | `begin_checkout` | Service ID and name, quantity, and the value, currency, and item price when a price is known |
| Completes a booking where pricing is shown | `purchase` | A transaction ID, Service ID and name, quantity, value, currency, and item price |

If a booking does not show a price, ServiceM8 records the completed form as a lead rather than a purchase. Revenue data is only sent when a price is known.

## Replace a Universal Analytics ID

Google retired Universal Analytics IDs beginning with `UA-`, so these IDs no longer collect data and cannot be used for Online Booking tracking.

If the **Google Analytics Tracking ID** field contains a stored `UA-` ID, ServiceM8 does not load it on your Online Booking pages. Replace it with a `G-` Measurement ID or `GT-` Google tag ID from your Google Analytics 4 property, then click **Save**.

If visits or booking revenue are missing from Google Analytics, first check that **Settings** > **Self Serve Online Booking** contains the current `G-` or `GT-` ID for your property. For revenue reporting, also confirm that the Online Booking Service shows a price.
