All Collections
Lodgix User Manual
Additional 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 a week 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.

In your Google Analytics account, in the Admin section, Property column... click Data Streams...

Select Configure tag settings...

Then select 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, Property column... click Events, then 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 from Settings > Important Settings > General...

Create Conversion

Now that the reservation event has been created, you will have to mark this event as a Conversion. This can be done from your Google Analytics account, in the Admin section, Property column. Click Conversions, then Create Conversion...

Name the Conversion 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. In the Conversions 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?