---
title: Google tag manager & Google analytics
description: Send booking widget events to Google Tag Manager or Google Analytics, or to your own page with analytics=bubble.
---

[Skip to content](https://help.nowbookit.com/knowledge-base/update-google-tag-manager-google-analytics#main-content)

English

Show submenu for translations

![NowBookIt-Alt-Logo 2-1](https://help.nowbookit.com/hs-fs/hubfs/NowBookIt-Alt-Logo%202-1.png?width=220&height=55&name=NowBookIt-Alt-Logo%202-1.png)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Knowledge Base](https://help.nowbookit.com/knowledge-base?hsLang=en)
2. [Venue](https://help.nowbookit.com/knowledge-base/venue?hsLang=en)
3. [Integrations](https://help.nowbookit.com/knowledge-base/venue?hsLang=en#integrations)

# Google tag manager & Google analytics

## Send booking widget events to Google Analytics 4, Universal Analytics, or Google Tag Manager, so you can see where guests book and where they drop off.

### Basic setup

1. Go to **Settings → Integrations → Integrations**. Under **Set up Google analytics**, click **Set up**.
   
   ![Integrations settings with Set up Google analytics in the Analytics card](https://help.nowbookit.com/hubfs/lucy-help-drafts/ga-integrations-1794967581608-1.png)
2. In **Google Tracking Id**, enter one ID: 
     - a Google Analytics 4 Measurement ID (looks like `G-XXXXXXXXXX`)
     - a Universal Analytics tracking ID (looks like `UA-XXXXX-Y`)
     - a Google Tag Manager ID (looks like `GTM-XXXXXXX`) — we add the right scripts for you
3. Select GTM Fields  
      
   ![](https://help.nowbookit.com/hs-fs/hubfs/image-png-Nov-18-2026-10-49-34-4889-PM.png?width=670&height=541&name=image-png-Nov-18-2026-10-49-34-4889-PM.png)

 

That's it for most venues. To count bookings as conversions in GA4, mark *Booking Confirmed* (and *Booking Paid*, if you take payments) as key events.

---

### Bubble up Method

Keep reading only if you need the tracking data sent to your own website instead, for example, to feed it into a third-party tracking tool.

Also tracking Meta (Facebook) conversions? That's a separate setup, see our Meta Pixel tracking article.

#### What the widget sends

Every event the widget fires uses the same name, category, and payload every time. If you're setting up Tag Manager triggers or GA4 key events, build them around these exact values.

#### Where the data goes

By default, the widget sends events straight to Google itself, using whichever ID you've set up. If you turn on `analytics=bubble` instead, the widget stops sending anything to Google directly. It hands each event to your website, and your own tracking setup forwards it on.

Every event includes the same core details: event, event\_category, event\_action, event\_label, and cookie\_flags. If the widget's launch link includes a `#referrer=` value, you'll also get a referrer field.

On GA4 (G-) IDs and in bubble mode, the extra details in the tables below sit alongside venue\_name at the top level of the event. On Universal Analytics or Tag Manager, you'll find them nested inside event\_data and event\_value.

### Conversion events

| Event | Category | What's in it | When it fires |
| --- | --- | --- | --- |
| Booking Confirmed | Booking | service\_name, service\_id, covers, section\_id, section\_name, service\_price, service\_type (+ any opted-in customer fields) | A booking was saved on a sitting that doesn't need payment. This is your standard "booking made" conversion. |
| Booking Paid | Payment | Same as above | A booking was saved and its payment or card guarantee went through. |
| Private Function Paid | Payment | service\_name, service\_id, covers, section\_id, section\_name, service\_price, service\_type | A private-function payment link was paid. |
| Booking Confirmed Online | Manage Booking | service\_name, service\_id, covers, section\_id, section\_name, service\_type (+ any opted-in customer fields) | A guest confirmed an existing booking from their email link. |
| Booking Edited Online | Manage Booking | — | A guest changed an existing booking from their email link. |
| Booking Cancelled Online | Manage Booking | — | A guest cancelled a booking, either from the link or the confirmation screen. |

For events marked "opted-in customer fields": if the venue has turned these on in the admin app, you'll also get whichever of email, phone, first\_name, last\_name, subscribed, and booking\_date they've opted into. If none are on, none of these fields are sent.

#### What happens as guests move through the widget

These events show the shape of the booking funnel — where guests land, what they change, and where they drop off.

| Event | Category | What's in it | When it fires |
| --- | --- | --- | --- |
| Covers updated | User input | covers\_count | Guest changed the party size. |
| Date selected | User input | date | Guest picked a different date. (The date the widget opens on isn't reported.) |
| Time selected | User input | time, service\_name, service\_id, service\_type | Guest picked a time — includes which sitting that time belongs to. |
| Booking option selected | User input | booking\_options | Guest changed their booking options or menu selections. |
| Event | URL | service\_name, service\_id | Guest arrived via a manage-booking link, for that booking's sitting. |
| Private Function | URL | service\_name, service\_id | Guest arrived via a private-function payment link. |
| Error saving | User input | — | The booking failed to save for some reason other than the time slot being taken. |
| Time expired | User input | — | The time the guest chose got taken by someone else while they were filling in their details. |
| Payment Timeout | Timeout | — | The guest ran out of time on the payment hold without paying. |

#### Screen views

Every screen in the widget sends its own event, named after that screen: Error, Select Venue, Booking Details (landing), Booking Details (takeaway), Customer Details, Payment Details, Thank You, Manage Booking, Standby List, Payment Details (private function), and Payment Confirmation.

Each screen view is sent as an event named after the page, with event\_category set to "Page View", plus page\_title, page\_url, and page.

The widget also pushes nbi\_widget\_step onto its own internal dataLayer every time the guest moves to a new step. This one doesn't leave the widget, so it's only useful if your tracking container runs inside the widget itself. If your container's on your own page, use the screen view events above instead.

Got a Meta Pixel connected too? It gets these same page names as its own events — see the Meta Pixel tracking article.

 Add a custom referrer in Tag Manager

1. In Tag Manager, go to **Workspace → Variables** and create a new user-defined variable. Call it something like "Custom Fragment Referrer".
2. Set the variable type to *URL* and the component type to *Fragment*.
3. Save and publish the variable.
4. Add `#referrer=MY_REFERRER_URL` to the end of the iframe's URL, swapping in your own value for MY\_REFERRER\_URL.

From then on, every event fired in Tag Manager carries your "Custom Fragment Referrer" value.

If you'd rather not use the URL fragment, the same value is also available as a property called referrer inside the dataLayer's eventModel object. You can use that as your variable's source instead.

#### When the referrer value changes

Sometimes you won't know the referrer value in advance. If you can't set `#referrer=` when the page loads with a back-end language like PHP, C#, or Java — often the case on website builders like Wix or Squarespace — set it with JavaScript instead. Add this after the iframe's HTML:

```
<script>
var frame = document.querySelector('[data-id="nbi-widget"]');
frame.src += '#referrer=' + window.location.href;
</script>
```

On Squarespace and similar builders, the code box you're typing into is often inside its own iframe, so reach one level further up with window.parent:

```
<script>
var frame = document.querySelector('[data-id="nbi-widget"]');
frame.src += '#referrer=' + window.parent.location.href;
</script>
```

Want to use a tracking ID instead of a referrer URL? First read it out of your page's URL (swap mytrackingid for whatever your parameter is called):

```
<script>
var url = new URL(window.location.href);
var trackingId = url.searchParams.get('mytrackingid');
</script>
```

Then pass it into the widget's iframe:

```
<script>
var frame = document.querySelector('[data-id="nbi-widget"]');
frame.src += '#referrer=' + trackingId;
</script>
```

 Send events to your own page instead

Want to handle the tracking data yourself rather than letting the widget send it straight to Google? Add `&analytics=bubble` to the widget's iframe URL. The widget then stops sending anything to Google itself and sends each event to your page. Add the matching code below to your page to catch that data and pass it on.

Note: The code below is for venues in Australia and New Zealand (`https://bookings.nowbookit.com`). In Canada, change it to `https://bookings.nowbookit.ca`. In the US, change it to `https://bookings.nowbookit.us`.

Send events to Google Tag Manager's dataLayer:

```
<script>
window.addEventListener('message', function (e) {
  if (e.origin !== 'https://bookings.nowbookit.com') return;
  if (!e.data || typeof e.data !== 'string') return;
  if (e.data.indexOf('NBIWidget2GoogleAnalytics') === -1) return;
  var payload;
  try {
    payload = JSON.parse(e.data);
  } catch (error) {
    // add your own logging here
    return;
  }
  if (payload.type !== 'NBIWidget2GoogleAnalytics' || !payload.event) return;
  var event = payload.event;
  var dataLayer = window.dataLayer || (parent.window && parent.window.dataLayer);
  if (dataLayer) dataLayer.push(event);
});
</script>
```

Send events to Google Analytics 3 (Universal Analytics), using ga():

```
<script>
window.addEventListener('message', function (e) {
  if (e.origin !== 'https://bookings.nowbookit.com') return;
  if (!e.data || typeof e.data !== 'string') return;
  if (e.data.indexOf('NBIWidget2GoogleAnalytics') === -1) return;
  var payload;
  try {
    payload = JSON.parse(e.data);
  } catch (error) {
    // add your own logging here
    return;
  }
  if (payload.type !== 'NBIWidget2GoogleAnalytics' || !payload.event) return;
  var event = payload.event;
  var ga = window.ga || (parent.window && parent.window.ga);
  if (!ga) return;
  if (event.page_title) {
    ga('send', { hitType: 'pageview', title: event.page_title, page: event.page_url });
  } else {
    ga('send', {
      hitType: 'event',
      eventCategory: event.event_category,
      eventAction: event.event_action,
      eventLabel: event.event_label,
    });
  }
});
</script>
```

Send events to Google Analytics 4, using gtag():

```
<script>
window.addEventListener('message', function (e) {
  if (e.origin !== 'https://bookings.nowbookit.com') return;
  if (!e.data || typeof e.data !== 'string') return;
  if (e.data.indexOf('NBIWidget2GoogleAnalytics') === -1) return;
  var payload;
  try {
    payload = JSON.parse(e.data);
  } catch (error) {
    // add your own logging here
    return;
  }
  if (payload.type !== 'NBIWidget2GoogleAnalytics' || !payload.event) return;
  var event = payload.event;
  if (typeof gtag !== 'function') return;
  if (event.page_title) {
    gtag('event', 'page_view', Object.assign({
      page_title: event.page_title,
      page_location: event.page_url,
    }, event));
  } else {
    gtag('event', event.event, Object.assign({
      event_category: event.event_category,
      event_action: event.event_action,
      event_label: event.event_label,
    }, event));
  }
});
</script>
```

Send events to your own third-party tracking tool. Every tool's setup is different, but you always read the data the same way, through payload.event:

```
<script>
window.addEventListener('message', function (e) {
  if (e.origin !== 'https://bookings.nowbookit.com') return;
  if (!e.data || typeof e.data !== 'string') return;
  if (e.data.indexOf('NBIWidget2GoogleAnalytics') === -1) return;
  var payload;
  try {
    payload = JSON.parse(e.data);
  } catch (error) {
    // add your own logging here
    return;
  }
  if (payload.type !== 'NBIWidget2GoogleAnalytics' || !payload.event) return;
  var event = payload.event;
  // event.event / event_category / event_action / event_label / value ...
  // send it wherever you need:
  // myTracker.track(event.event, event);
  console.log('nbi widget event', event);
});
</script>
```

 Good to know

- To test before you go live, open the booking widget's embed builder and reload the reference page with `&my-analytics-test=true` added to the URL. That flags the page in Google Analytics so it's easy to spot. Paste in your own G-, GTM-, or UA- ID, and every widget on the page uses it.

- [Getting Started](https://help.nowbookit.com/knowledge-base/getting-started?hsLang=en#main-content)

    - [Organisation Settings](https://help.nowbookit.com/knowledge-base/getting-started?hsLang=en#organisation-settings)
    - [Venue Settings](https://help.nowbookit.com/knowledge-base/getting-started?hsLang=en#venue-settings)
    - [Customisation](https://help.nowbookit.com/knowledge-base/getting-started?hsLang=en#customisation)
    - [Today](https://help.nowbookit.com/knowledge-base/getting-started?hsLang=en#today)
- [Venue](https://help.nowbookit.com/knowledge-base/venue?hsLang=en#main-content)

    - [General](https://help.nowbookit.com/knowledge-base/venue?hsLang=en#general)
    - [Bookings](https://help.nowbookit.com/knowledge-base/venue?hsLang=en#bookings)
    - [Diary](https://help.nowbookit.com/knowledge-base/venue?hsLang=en#diary)
    - [Tables](https://help.nowbookit.com/knowledge-base/venue?hsLang=en#tables)
    - [Integrations](https://help.nowbookit.com/knowledge-base/venue?hsLang=en#integrations)
    - [Gift Cards](https://help.nowbookit.com/knowledge-base/venue?hsLang=en#gift-cards)
    - [Take Away](https://help.nowbookit.com/knowledge-base/venue?hsLang=en#take-away)
- [Events & Functions](https://help.nowbookit.com/knowledge-base/events-functions?hsLang=en#main-content)

    - [Events](https://help.nowbookit.com/knowledge-base/events-functions?hsLang=en#events)
- [Payments and Gift Cards](https://help.nowbookit.com/knowledge-base/payments-and-gift-cards?hsLang=en#main-content)

    - [Gift Cards](https://help.nowbookit.com/knowledge-base/payments-and-gift-cards?hsLang=en#gift-cards)
    - [Payments](https://help.nowbookit.com/knowledge-base/payments-and-gift-cards?hsLang=en#payments)
- [Integrations](https://help.nowbookit.com/knowledge-base/integrations?hsLang=en#main-content)

    - [POS Integrations](https://help.nowbookit.com/knowledge-base/integrations?hsLang=en#pos-integrations)
    - [Other Integrations](https://help.nowbookit.com/knowledge-base/integrations?hsLang=en#other-integrations)
- [Reporting](https://help.nowbookit.com/knowledge-base/reporting?hsLang=en#main-content)

    - [NBInsights](https://help.nowbookit.com/knowledge-base/reporting?hsLang=en#nbinsights)
- [CRM](https://help.nowbookit.com/knowledge-base/crm?hsLang=en)

[![NBI logo-KB](https://help.nowbookit.com/hs-fs/hubfs/NBI%20logo-KB.png?width=200&height=80&name=NBI%20logo-KB.png "NBI logo-KB")](http://nowbookit.com)

Need more assistance? 

email: [help@nowbookit.com](mailto:help@nowbookit.com)

Call us:

- Australia: [1800 265 726](tel:1800265726)
- New Zealand: [0800 453 933](tel:0800453933)
- United States: [1 469 458 6874](tel:14694586874)
- Canada: [1 438 794 9945](tel:14387949945)
- International: [+61 2 7912 1576](tel:61279121576)

<https://www.facebook.com/nowbookitNBI/> <https://www.instagram.com/now_book_it> [mailto:help@nowbookit.com](mailto:help@nowbookit.com) <https://au.linkedin.com/company/now-book-it> <https://www.youtube.com/@NowBookIt>

Copyright © 2026, Now Book It