Connect Google Analytics 4
Connecting a Google Analytics 4 property tags your public PiGi booking pages, reports each paid online booking to GA4 as a purchase, and shows your visitors, traffic sources and ad spend on Marketing → Analytics. You need a GA4 property, its Measurement ID (G-…) and property ID, and an OAuth client from your own Google Cloud project.
Updated 2026-10-01
Quick answers
What does PiGi send to Google Analytics?
A page view for every page of your public PiGi site, a begin_checkout event when a customer reaches the payment step of the booking wizard, and a purchase event — with the booking reference, value and currency — when an online booking is confirmed. The purchase is sent from PiGi's server, so it still counts if the customer closes the tab or blocks scripts.
Where do I find my Measurement ID?
In Google Analytics: Admin → Data collection and modification → Data streams, click your web stream, and copy the Measurement ID that starts with G-.
What is the difference between the property ID and the Measurement ID?
The GA4 property ID is digits only, from Admin → Property settings; PiGi uses it to read your reports. The Measurement ID starts with G- and tags your pages. PiGi needs both.
Do I need the Measurement Protocol API secret?
It is optional but recommended. Without it PiGi cannot report a paid booking to GA4 as a purchase. Create it under your web stream → Measurement Protocol API secrets → Create.
Do I need to mark purchase as a key event?
No. Google marks purchase as a key event by default on web properties.
Why does Marketing → Analytics say Google Ads isn't linked?
Ad cost, clicks and return on ad spend only reach PiGi through GA4's link to Google Ads. Link them in GA4 under Admin → Product links → Google Ads links. Nothing changes in PiGi.
Are my walk-in and desk bookings sent to Google?
No. Only bookings made on your public site in a browser that GA4 tagged are reported.
Does it track staff using the admin app?
No. The tag is only on your public booking site.
What this does
Google Analytics 4 measures who visits your booking site and which campaigns produce bookings. PiGi tags the public pages with your Measurement ID, reports confirmed online bookings as purchases, and reads the property back to show visitors, channels, landing pages and ad spend on Marketing → Analytics beside your booking revenue. GA4 itself is free; Google's own terms apply.
Before you start
- The admin role in PiGi.
- A Google Analytics account with permission to create a property and data stream.
- Access to the Google Cloud console to create an OAuth client.
Set up Google Analytics and Google Cloud
- In Google Analytics, go to Admin → Create → Property, and follow the steps.
- Under Admin → Data collection and modification → Data streams, click Add stream → Web, enter your booking site address (your custom domain, or
<your-slug>.pigi.io) and click Create stream. - Copy the Measurement ID (
G-…) from Stream details. - On the same stream, open Measurement Protocol API secrets, click Create, and copy the Secret value.
- Copy the numeric Property ID from Admin → Property settings.
- In the Google Cloud console, enable the Google Analytics Data API on your project (APIs & Services → Library).
- Set up the consent screen under Google Auth platform → Branding. For an External app, set the publishing status on Audience to In production; in Testing, Google's access expires after 7 days.
- Go to Google Auth platform → Clients → Create Client → Web application. Leave Authorized redirect URIs for now and click Create. Copy the client ID and secret. For every screen in detail, see Get Google OAuth credentials.
Connect it to PiGi
- Open Settings → Communication → Integrations, click the Google Analytics 4 tile and then Connect Google Analytics 4.
- Click Add credentials and fill in OAuth client ID, OAuth client secret, GA4 property ID, Measurement ID and Measurement Protocol API secret. Press Save.
- Click Google authorisation. Copy the redirect URI shown at the bottom.
- Back in Google Cloud, edit the OAuth client, add that URI under Authorized redirect URIs exactly as shown, and save.
- In PiGi, click Connect Google and allow access with a Google account that can read the property. The dialog then shows Authorised.
Test it
- Open your public booking site in a private window.
- In GA4, open the Realtime report and confirm your visit appears.
- Make and pay for a test booking, then look for the
purchaseevent in Realtime. - Open Marketing → Analytics in PiGi to see the website figures.
Troubleshooting
- "Google turned the authorisation down." The redirect URI on the OAuth client does not exactly match the one in the dialog. A trailing slash counts as different.
- "Google did not return a refresh token…" Remove PiGi from your Google account permissions, then connect again.
- "No property ID saved yet." Add the GA4 property ID under Update credentials.
- "This integration has no OAuth client ID or secret yet." Save both before pressing Connect Google.
- Marketing → Analytics says "Google Analytics isn't connected". Authorisation is missing or the property ID is missing.
- "No conversions are being measured yet." No purchase has reached GA4 yet. Check the API secret is saved and make a test booking.
Known limitations
- An OAuth client is required even if you only want the page tag.
- Test connection reports that testing isn't supported for this provider yet.
- PiGi loads the tag without asking visitors for cookie consent first. Check what your local privacy law requires.
- Only bookings made on the tagged public site are reported as purchases.