Skip to main content
All CollectionsLodgix User ManualAdditional Features
Tracking Scripts - Google Analytics 4
Tracking Scripts - Google Analytics 4

How to configure Google Analytics 4 to work with Lodgix

Joseph Alvaro avatar
Written by Joseph Alvaro
Updated over 2 months ago

GA4 vs Universal Analytics

The instructions in this article are specific to Google Analytics 4. If you are looking to setup Google Universal Analytics to work with Lodgix, please refer to this support article instead.

Google Analytics 4 Setup

This article assumes that you have setup Google Analytics 4 by creating your Account, Property, and Data Stream, and that you have added the Google Tag to your website. Instructions from Google for basic GA4 setup can be found here: https://support.google.com/analytics/answer/9304153

Add Google Tag to Lodgix

You will install the Google Tag in Lodgix from Settings > Important Settings > Bookings. This tag should be identical to the one installed on your website...

  1. Paste the tag

  2. Click "Insert tracking script in Header"

  3. Save

Setup Cross Domain Tracking

Cross domain tracking allows you to track the same site visitor session as they move from one domain to another, in this case from your website to the Lodgix booking page where the guest will complete the booking.

Navigate to the Admin section in your Google Analytics account...

Select Property Settings > Data Collection > Data Streams...

Either add a new stream or select the existing stream...

Configure tag settings...

Configure your domains...

From here you will add lodgix.com as one domain, and your domain as the other. In this example we are configuring GA4 for the mauitheme.com domain...

Now that we are tracking users across multiple domains, we will want to track Conversions (reservations) so that we can view them within Google Analytics.

Create Event

In your Google Analytics account, in the Admin section, select Property Settings > Data Display > Events...

Click Create event...

Configure your event with the following conditions, then click Save. Note that you will replace XXXXX in the second condition with your Lodgix customer ID, which can be found within Lodgix under Settings > Important Settings > General...

Create Key Event

Now that the reservation event has been created, you will have to mark this event as a Key Event. This can be done from your Google Analytics account. In the Admin section, select Property Settings > Data Display > Key Events...

Click New key event...

Name the Key Event "reservation" and click Save...

Test in Real Time

You can test the conversion immediately after configuring it. Start by submitting a test booking through your website. Then within your Analytics account, navigate to Reports > Realtime overview. In the Key Events view you should see that the "reservation" event was triggered...

Purchase Event Data

The following data is passed to Google Analytics once the reservation is completed in Lodgix...

- transaction_id: ...,  # invoice id
- event_label: "Lodgix Reservation",
- tax: ..., # total taxes
- value: ..., # total price (item prices + total taxes)
- items:
- id: ..., # property id
name: ..., # property name
quantity: 1,
price: ..., # rent amount after subtracting discount
coupon: ..., # coupon if used

Did this answer your question?