---
title: gtag.js Tracking
slug: gtagjs-tracking
createdAt: 2021-07-15T20:13:45.000Z
---

We do have a GDPR compliant opt-in for tracking - tracking only starts once the user accepted tracking cookies.

## Page Views

event\_name = 'page\_view'
page\_title = one of the following values

- home
- roomcount
- roomselect
- rateselect
- contact
- payment
- summary
- confirmation

## E-Commerce Tracking

On page **roomselect** the event **view\_item\_list** will be triggered with the following parameters:

- items
  - id = ROOM\_TYPE\_ID
  - name = ROOM\_TYPE\_NAME (in the displayed language)
  - list\_position = position on the screen (0 indexed)
  - category = 'RoomType'

On page **rateselect** the event **view\_item** will be triggered with the following parameters:

- items
  - id = room type id
  - name = room type name (in the displayed language)
  - category = 'RoomType'

On page **summary** the event **begin\_checkout** will be triggered with the following parameters:

- id = ROOM\_TYPE\_ID/RATE\_PLAN\_ID
- name = ROOM\_TYPE\_NAME / RATE\_PLAN\_NAME
- list\_position = room request number (0 indexed)
- category = 'Product'
- price = total amount including all taxes and surcharges

On page **payment** the event **purchase** will be triggered with the following parameters:

- transactionId = CONFIRMATION\_CODE
- value = total amount of all rooms including all taxes and surcharges
- currency = currency code (defaults to hotels primary currency)

After the purchase event the user is redirected to the **summary** page

## Sample Funnel

- event = session\_start
- page\_view page\_title = home
- page\_view page\_title = roomcount&#x20;
- page\_view page\_title = roomselect
- page\_view page\_title = rateselect
- page\_view page\_title = contact
- event = begin\_checkout
- event = purchase

# Universal Analytics

In case you are not using Google Analytics 4, but instead using Universal Analytics (or any older version of Google Analytics) you may require the following information to configure your conversion goals and/or funnel steps.

## Page Views

While Google Analytics 4 does rely on `page_title`, older versions of Google Analytics do use the `page_path` instead.

For compatability reasons we have opted to use the `page_title` prefixxed with a `/` character as the `page_path`. Meaning if the `page_title` is `home` the `page_path` will be `/home`.

## Events

While Google Analytics 4 does rely on `event_action`, older versions of Google Analytics do also require an `event_category`. In the following section we have listed the `even_category` for the most important events.

### view\_item\_list

Event Category: engagement
Event Action: view\_item\_list

### view\_item

Event Category: engagement
Event Action: view\_item

### add\_to\_cart

Event Category: ecommerce
Event Action: add\_to\_cart

### begin\_checkout

Event Category: ecommerce
Event Action: begin\_checkout

### checkout\_progress

Event Category: ecommerce
Event Action: checkout\_progress

### purchase

Event Category: ecommerce
Event Action: purchase

