Case studies

Case Study: Audit and Setup of ecommerce Google Analytics 4 (GA4) for a Ticket Service

Редакція Spilno Agency | 30 Apr 2026 Updated: 06 May 2026 | 21 min read 0 views

In this article, we will document the audit of the ecommerce Google Analytics 4 module that we conducted for one of our clients. The purpose of this article is to demonstrate an example and the scope of work involved in auditing and setting up GA4 for custom-built services and online stores.

Why track additional data in Google Analytics at all?

The main purpose of tracking this data is its subsequent use for analyzing advertising channels recorded in Google Analytics. For example, to compare the effectiveness of Google Ads and Instagram advertising channels. Setting up the ecommerce module in Google Analytics 4 allows us not just to compare the cost per lead within advertising channels, but to collect information on the profitability of these channels for further comparison.

What exactly is the result of the audit and what does it look like?

The conversion audit and the technical specification for setting up the ecommerce Google Analytics 4 module are prepared by us in the form of a Google document.

Introductory Information
In this document, we record information related to the analysis of the current state of web analytics. Specifically, this includes conversion data. We also document technical tasks for additional setup of conversion web analytics.


Website Development Technologies
The website is developed and operates using the following technologies.

Frontend: React.js, Next.js
Backend: FastAPI (Python 3.11)
Database: Postgresql

API type: REST
Cloud: DigitalOcean Apps, Spaces(S3)

Version Control System: GitHub
CI/CD: GitHub actions
Unit tests (BE): pytest

Docker Containerization: docker compose

Web Analytics Tools
Google Analytics 4 web analytics system resource ID
Web analytics data stream ID
Data stream identifier

Google Tag Manager container ID


Web Analytics Code Analysis


Placement of Web Analytics System Codes

The main and additional code snippets of the Google tag management system are generally placed correctly. The code contains a number of customizations and additional settings. The site also hosts additional codes for the Google Analytics 4 web analytics system, as well as an additional code for DataLayer. Furthermore, the block contains another group of programmatic tags and code blocks from various systems. Some of them are not placed entirely correctly.

Analysis of Web Analytics Systems
Overall status of Google Tag Manager
The Google Tag Manager container is generally configured correctly.

Tracking Target Actions
Google Tag Manager is configured to track useful user actions on the website.
The transfer of information about these events to Google Analytics 4 is also configured.

Conversion Tracking
Certain settings for tracking conversions and ticket sales have been implemented in Google Tag Manager and also in the website’s program code.

However, as will be shown later in this document, tracking is occurring incorrectly.

Conversion Testing
The reason for conducting the analysis and fine-tuning web analytics was the assumption that Google Analytics 4 correctly records conversions, specifically ticket purchase registrations made with online payment immediately after booking.

Ticket bookings with payment to the driver are also recorded, but the amount of such conversions is not.

The conducted analysis shows that this is not true; conversion recording occurs with significantly broader errors.

Test Ticket Purchase
To test the actual operation of the website, Google Tag Manager, and Google Analytics 4, we perform ticket registrations.

For such registrations, we specify the following parameters.
Name: TEST
Surname: TESTOVICH
Phone: number with repeating digits.
Email: [email protected]

Website Testing Results
On 2024-05-21, a series of test ticket purchases was conducted. When booking tickets, payment to the driver was selected.

Conversions were successfully recorded in the web analytics system.

However, the total sum of all conversions corresponds to the last conversion:

Conversion Statistics Analysis
Sales Table Analysis
An analysis of the current version of the order statistics file was conducted.

Its results are presented in the document – [link to file]

Statistics for April and part of May 2024 show that approximately 15-18% of buyers pay online by quantity, which accounts for only about 12-13% of the total value of tickets sold.

Accordingly, about 82-85% of buyers prefer to pay on the spot. This accounts for about 86% of the total value of purchased or booked tickets.

Analysis of Google Analytics 4 Reports
Analysis of e-commerce reports shows that sales data is not being recorded correctly.

Here are examples of consolidated report fragments – [list of tickets purchased during testing].

However, some information is still being recorded:

Table and Report Comparison
We also conducted a comparative analysis of the ticket sales table data and the report in the web analytics system.

A common period from 2024-04-01 to 2024-05-21 inclusive was chosen, i.e., from April 1 to May 21, 2024.

According to the table, the total number of sales for April is 223, of which 35 were paid online and 188 were paid to the driver. The total sales amount for April is 636,553 UAH, with 86,795 UAH from online payments and 549,758 UAH from on-site payments.
Accordingly, according to the web analytics report, the total number of sales is 237, and the total sales amount is 468,489 UAH.

Similarly, for the period from May 1 to May 21, the total number of sales according to the table is 210, of which 37 are online payments and 173 are payments to the driver. The total sales amount for this period is 590,055 UAH, with 78,709 UAH from online payments and 511,346 UAH from planned payments to drivers.

However, according to web analytics, from May 1 to May 21, the total number of sales is 183, and the total sales amount is 143,177 UAH.

The discrepancies are quite significant. Details still need to be clarified, various factors considered, and different assumptions verified.

Systematization of Conversion Tracking
General Information
Since the conducted analysis revealed that conversion tracking occurs with significant errors, it makes sense not just to identify and locally eliminate local errors, but also to carry out a more comprehensive systematization of e-commerce event tracking on the website.


Tickets as Products
Within this project, it is appropriate to consider tickets as individual products, distinguished by their departure and destination cities.

This will allow for building informative reports on combinations of departure and arrival cities in the future.


Tickets as Product Pairs
Another somewhat specific, but also interesting, option could be to record the viewing or purchase of a ticket as a combination of two products – the departure city and the arrival city.

In this case, it will be possible to generate and use more convenient and informative reports on the economic popularity of individual cities in the future.

Product Categories
As top-level categories, we can record the country.

Product Category Hierarchy
Potentially, a four-level nested product catalog option can also be considered.

The first level is the country of departure.
The second is the country of arrival.
The third is the city of departure.
And the fourth is the city of arrival.

Such a structure will also allow for creating quite informative reports by cities and countries.

Brands
We can record the carrier’s name in the web analytics system as a product brand. This will allow for generating reports on different carriers in the future.

Product Parameters
We record other product information in the web analytics system as parameters of the purchased product.

In particular, a very important parameter is the departure date and time of the purchased ticket.
Other purchase parameters include the passenger’s name and phone number.

Transaction Parameters
The date and time of the purchase will be automatically recorded as transaction parameters.
The chosen payment method is also a very important transaction parameter.

It is also possible to generate unique transaction numbers at the website engine level and record them in the analytics system.

Conversion Value
At this stage of web analytics setup, the total value of purchased or booked tickets can be recorded as the conversion value.

Accordingly, the value of product sales is the price recorded, taking into account possible discounts and benefits for certain transportation routes and specific carriers.

Conversion Tracking
The main event that must be configured for tracking is a completed conversion, the purchase of one or more tickets.

Product View Tracking
In addition to conversions and product sales, we can also track product views.

Specifically, when a user selects a departure city and an arrival city in the form, we can record this as a product view.

Add to Cart Tracking
Clicking the “Buy” button can be recorded as an add to cart event.

Potentially, in the future, this could enable setting up remarketing for abandoned carts.

Tracking Purchase Stages
We can track users reaching individual stages of the purchase process.

Specifically, there is the first stage of data entry, then the stage of selecting payment parameters, then the payment stage using acquiring, and finally the final stage of purchase confirmation and electronic ticket delivery.

Tracking these stages will allow us to monitor in the future whether users correctly complete each stage and successfully reach the final page for receiving the electronic ticket.

Testing shows that there are certain problems with this. However, only tracking setup, data accumulation, and subsequent analysis of the obtained data can reveal how often this occurs for real users.

Tracking Cancellations/No-shows
The actual boarding and payment-to-driver rate can be significantly less than one. It can also vary significantly for different cities, different promotion channels, and different time periods.

To control this parameter, and also to remove clearly incorrect transactions, it would be good to set up cancellation tracking.

This can be implemented as a product return. However, this requires settings not only on the website but also in a certain, albeit very simple, CRM system for order processing.

Essentially, this is the first step towards end-to-end marketing and sales analytics.

Profit Tracking
And the second step towards end-to-end analytics is accounting not just for sales value, but specifically for the gross profit from specific sales for the company.

This will allow for tracking and optimizing the ROI of paid promotion segments across various advertising campaigns, groups, ads, audiences, and other parameters.


Technical Tasks for Data Layer Preparation
General Information
In this section, we document the technical tasks that need to be implemented on the website engine side.

They concern the setup of a special JavaScript Data Layer variable.

On different pages and under different conditions, values of various parameters will need to be entered into this variable. These values should be taken from the website engine’s code.

Further on the pages, parameters that need to be replaced with actual values are indicated in angle brackets (<>). The angle brackets and their content should be replaced with the corresponding actual values.

Attention! It is very important to preserve pairs of straight double quotes at the beginning and end of the value (” “), if specified in the code template and example.

Existing Code
Certain code blocks, similar to those presented below, were previously added to specific sections of the website’s code.

They were also intended for sales tracking. However, as shown earlier in this document, they contain very significant limitations and even errors.

Therefore, please document these code blocks and their location. In general, please save the current version of the website before making any changes.

However, moving forward, when adding the codes presented below, please either remove the existing code or very carefully update it so that it fully matches the code presented below.

Viewing Tickets by City Pair
Code placement and triggering conditions:
This code should trigger when loading a page that displays available or unavailable flights for a selected pair of departure and arrival cities.
That is, during the loading process of the flight options page.

Page template:
The addresses of these pages start with [Website URL] and then contain the names and codes of the departure and arrival cities.

Code to be placed and initiated:

gtag("event", "view_item", {
currency: "UAH",
value: 10,
items: [
{
item_id: "<Фрагмент адреси сторінки>",
item_name: "<Назва міста відправлення - Назва міста прибуття>",
affiliation: "[назва сервісу]",
index: 0,
item_brand: "",
item_category: "<Країна відправлення>",
item_category2: "<Країна прибуття>",
item_category3: "<Місто відправлення>",
item_category4: "<Місто прибуття>",
price: 10,
quantity: 1
}
]
});

Example of corresponding parameter value population:


gtag("event", "view_item", {
currency: "UAH",
value: 10,
items: [
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
index: 0,
item_brand: "",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
price: 10,
quantity: 1
}
]
});

Selecting a Specific Ticket

Code placement and triggering conditions:
This code should trigger after clicking the “Select Ticket” button, once the date and a specific flight for that date have been chosen.

Page template:
The same pages as in the previous point.

Code to be initiated:

gtag("event", "add_to_cart", {
currency: "UAH",
value: <Вартість обраного квитку>,
items: [
{
item_id: "<Фрагмент адреси сторінки>",
item_name: "<Назва міста відправлення - Назва міста прибуття>",
affiliation: "[назва сервісу]",
index: 0,
item_brand: "<Конкретний перевізник обраного рейсу>",
item_category: "<Країна відправлення>",
item_category2: "<Країна прибуття>",
item_category3: "<Місто відправлення>",
item_category4: "<Місто прибуття>",
item_variant: "<Дата та час відправлення та прибуття в структурованому форматі>",
price: <Вартість обраного квитку>,
quantity: 1
}
]
});

Example of corresponding parameter value population:

gtag("event", "add_to_cart", {
currency: "UAH",
value: 2850,
items: [
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
index: 0,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35",
price: 2850,
quantity: 1
}
]
});

Initiating Ticket Booking

Code placement and triggering conditions:
This code should trigger specifically when the “Ticket Booking” page is opened.

Page template:
The addresses of these pages start with [Website URL] and then contain the hash code of the selected flight.

Code to be initiated:

gtag("event", "view_cart", {
currency: "UAH",
value: <Вартість обраного квитку>,
items: [
{
item_id: "<Фрагмент адреси сторінки>",
item_name: "<Назва міста відправлення - Назва міста прибуття>",
affiliation: "[назва сервісу]",
index: 0,
item_brand: "<Конкретний перевізник обраного рейсу>",
item_category: "<Країна відправлення>",
item_category2: "<Країна прибуття>",
item_category3: "<Місто відправлення>",
item_category4: "<Місто прибуття>",
item_variant: "<Дата та час відправлення та прибуття в структурованому форматі>",
price: <Вартість обраного квитку>,
quantity: 1
}
]
});

Example of corresponding parameter value population:

gtag("event", "view_cart", {
currency: "UAH",
value: 2850,
items: [
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: “[назва сервісу]",
index: 0,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35",
price: 2850,
quantity: 1
}
]
});

Adding a Passenger

Code placement and triggering conditions:
This code should trigger on the “Ticket Booking” page after each click of the “Add Passenger” button.
Attention! Specifically after each click.

Page template:
The same page as in the previous point.

Code to be initiated:

gtag("event", "add_to_cart", {
currency: "UAH",
value: <Вартість попереднього квитка з урахуванням знижки>,
items: [
{
item_id: "<Фрагмент адреси сторінки>",
item_name: "<Назва міста відправлення - Назва міста прибуття>",
affiliation: "[назва сервісу]",
coupon: "<Назва знижки та детали>",
discount: <Розмір знижки без знаку мінус>,
index: <Номер попереднього квитка, починаючи з одиниці>,
item_brand: "<Конкретний перевізник обраного рейсу>",
item_category: "<Країна відправлення>",
item_category2: "<Країна прибуття>",
item_category3: "<Місто відправлення>",
item_category4: "<Місто прибуття>",
item_variant: "<Дата та час відправлення та прибуття в структурованому форматі>",
price: <Вартість обраного квитку>,
quantity: 1
}
]
});

Example of such a page:
The same as in the previous point.

Example of corresponding parameter value population:

gtag("event", "view_cart", {
currency: "UAH",
value: 1425,
items: [
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
coupon: "За віком: до 6 р. -50% - 2020-02-26",
discount: 1425,
index: 1,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35 І",
price: 1425,
quantity: 1
}
]
});

Proceeding to Payment Parameters

Code placement and triggering conditions:
This code should trigger on the “Ticket Booking” page after each click of the “Next” button, specifically when all data is filled in and the transition to the payment parameters page will occur next.
Attention! If any data is not filled in, this code should not be triggered.

Page template:
The same page as in the previous point.

Code to be initiated:

gtag("event", "begin_checkout", {
currency: "UAH",
value: <Загальна вартість всіх квитків>,
items: [
{
item_id: "<Фрагмент адреси сторінки>",
item_name: "<Назва міста відправлення - Назва міста прибуття>",
affiliation: "[назва сервісу]",
coupon: "<Назва знижки та детали першого квитка, пусто, якщо немає>",
discount: <Розмір знижки без знаку мінус першого квитка, 0, якщо немає>,
index: 0,
item_brand: "<Конкретний перевізник обраного рейсу>",
item_category: "<Країна відправлення>",
item_category2: "<Країна прибуття>",
item_category3: "<Місто відправлення>",
item_category4: "<Місто прибуття>",
item_variant: "<Дата та час відправлення та прибуття в структурованому форматі прізвище та ім’я першого пасажира>",
price: <Вартість першого квитку>,
quantity: 1
},
{
item_id: "<Фрагмент адреси сторінки>",
item_name: "<Назва міста відправлення - Назва міста прибуття>",
affiliation: "[назва сервісу]",
coupon: "<Назва знижки та детали другогоквитка, пусто, якщо немає>",
discount: <Розмір знижки без знаку мінус другого квитка, 0, якщо немає>,
index: 1,
item_brand: "<Конкретний перевізник обраного рейсу>",
item_category: "<Країна відправлення>",
item_category2: "<Країна прибуття>",
item_category3: "<Місто відправлення>",
item_category4: "<Місто прибуття>",
item_variant: "<Дата та час відправлення та прибуття в структурованому форматі прізвище та ім’я другого пасажира>",
  price: <Вартість другого квитку>,
  quantity: 1
},

<….>
]
});

Example of corresponding parameter value population:

gtag("event", "begin_checkout", {
currency: "UAH",
value: 3705,
items: [
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
coupon: "За віком: до 6 р. -50% - 2020-02-26",
discount: 1425,
index: 1,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35 ТЕСТ ТЕСТОВИЧ",
price: 1425,
quantity: 1
},
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
coupon: "За віком: до 13 р. -20% - 2014-05-17",
discount: 570,
index: 1,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35 ТЕСТ 2 ТЕСТОВИЧ 2",
price: 2280,
quantity: 1
}
]
});

Selected Payment on Board

Code placement and triggering conditions:
This code should trigger at the second stage of “Ticket Booking”, specifically after clicking the “Payment on Board” button.


Attention! This code should only be executed if all checks are completed, including the “I agree with…” checkbox being enabled.

Page template:
The address of this page matches the template.

Code to be initiated:


gtag("event", "add_payment_info", {
currency: "UAH",
value: <Загальна вартість всіх квитків>,
payment_type: "Cash (to the bus driver)",
items: [
{
item_id: "<Фрагмент адреси сторінки>",
item_name: "<Назва міста відправлення - Назва міста прибуття>",
affiliation: "[назва сервісу]",
coupon: "<Назва знижки та детали першого квитка, пусто, якщо немає>",
discount: <Розмір знижки без знаку мінус першого квитка, 0, якщо немає>,
index: 0,
item_brand: "<Конкретний перевізник обраного рейсу>",
item_category: "<Країна відправлення>",
item_category2: "<Країна прибуття>",
item_category3: "<Місто відправлення>",
item_category4: "<Місто прибуття>",
item_variant: "<Дата та час відправлення та прибуття в структурованому форматі прізвище та ім’я першого пасажира>",
price: <Вартість першого квитку>,
quantity: 1
},
{
item_id: "<Фрагмент адреси сторінки>",
item_name: "<Назва міста відправлення - Назва міста прибуття>",
affiliation: "[назва сервісу]",
coupon: "<Назва знижки та детали другогоквитка, пусто, якщо немає>",
discount: <Розмір знижки без знаку мінус другого квитка, 0, якщо немає>,
index: 1,
item_brand: "<Конкретний перевізник обраного рейсу>",
item_category: "<Країна відправлення>",
item_category2: "<Країна прибуття>",
item_category3: "<Місто відправлення>",
item_category4: "<Місто прибуття>",
item_variant: "<Дата та час відправлення та прибуття в структурованому форматі прізвище та ім’я другого пасажира>",
  price: <Вартість другого квитку>,
  quantity: 1
},

<….>
]
});

Example of corresponding parameter value population:

gtag("event", "add_payment_info", {
currency: "UAH",
value: 3705,
payment_type: "Cash (to the bus driver)",
items: [
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
coupon: "За віком: до 6 р. -50% - 2020-02-26",
discount: 1425,
index: 1,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35 ТЕСТ ТЕСТОВИЧ",
price: 1425,
quantity: 1
},
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
coupon: "За віком: до 13 р. -20% - 2014-05-17",
discount: 570,
index: 1,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35 ТЕСТ 2 ТЕСТОВИЧ 2",
price: 2280,
quantity: 1
}
]
});

Selected Online Payment

Code placement and triggering conditions:
This code should trigger at the second stage of “Ticket Booking”, specifically after clicking the “Online Payment” button.


Attention! This code should only be executed if all checks are completed, including the “I agree with…” checkbox being enabled.

Page template:
The same as in the previous point.

Code to be initiated:

gtag("event", "add_payment_info", {
currency: "UAH",
value: <Загальна вартість всіх квитків>,
payment_type: "Credit Card (online)",
items: [
{
item_id: "<Фрагмент адреси сторінки>",
item_name: "<Назва міста відправлення - Назва міста прибуття>",
affiliation: "[назва сервісу]",
coupon: "<Назва знижки та детали першого квитка, пусто, якщо немає>",
discount: <Розмір знижки без знаку мінус першого квитка, 0, якщо немає>,
index: 0,
item_brand: "<Конкретний перевізник обраного рейсу>",
item_category: "<Країна відправлення>",
item_category2: "<Країна прибуття>",
item_category3: "<Місто відправлення>",
item_category4: "<Місто прибуття>",
item_variant: "<Дата та час відправлення та прибуття в структурованому форматі прізвище та ім’я першого пасажира>",
price: <Вартість першого квитку>,
quantity: 1
},
{
item_id: "<Фрагмент адреси сторінки>",
item_name: "<Назва міста відправлення - Назва міста прибуття>",
affiliation: "[назва сервісу]",
coupon: "<Назва знижки та детали другого квитка, пусто, якщо немає>",
discount: <Розмір знижки без знаку мінус другого квитка, 0, якщо немає>,
index: 1,
item_brand: "<Конкретний перевізник обраного рейсу>",
item_category: "<Країна відправлення>",
item_category2: "<Країна прибуття>",
item_category3: "<Місто відправлення>",
item_category4: "<Місто прибуття>",
item_variant: "<Дата та час відправлення та прибуття в структурованому форматі прізвище та ім’я другого пасажира>",
  price: <Вартість другого квитку>,
  quantity: 1
},

<….>
]
});

Example of corresponding parameter value population:


gtag("event", "add_payment_info", {
currency: "UAH",
value: 3705,
payment_type: "Credit Card (online)",
items: [
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
coupon: "За віком: до 6 р. -50% - 2020-02-26",
discount: 1425,
index: 1,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35 ТЕСТ ТЕСТОВИЧ",
price: 1425,
quantity: 1
},
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
coupon: "За віком: до 13 р. -20% - 2014-05-17",
discount: 570,
index: 1,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35 ТЕСТ 2 ТЕСТОВИЧ 2",
price: 2280,
quantity: 1
}
]
});

Tickets Sold!

Code placement and triggering conditions:
This code should trigger when loading the final “Done!” page, confirming successful ticket booking and payment, if that option was chosen.

Page template:
The addresses of these pages start with [Website URL] and then contain the transaction code.

Code to be initiated:


gtag(“event”, “purchase”, {
transaction_id: “<Код транзації>”,
currency: “UAH”,
value: <Загальна вартість всіх квитків>,
items: [
{
item_id: “<Фрагмент адреси сторінки>”,
item_name: “<Назва міста відправлення – Назва міста прибуття>”,
affiliation: “[назва сервісу]”,
coupon: “<Назва знижки та детали першого квитка, пусто, якщо немає>”,
discount: <Розмір знижки без знаку мінус першого квитка, 0, якщо немає>, index: 0,
item_brand: “<Конкретний перевізник обраного рейсу>”,
item_category: “<Країна відправлення>”,
item_category2: “<Країна прибуття>”,
item_category3: “<Місто відправлення>”,
item_category4: “<Місто прибуття>”,
item_variant: “<Дата та час відправлення та прибуття в структурованому форматі прізвище та ім’я першого пасажира>”,
price: <Вартість першого квитку>, quantity: 1
},
{
item_id: “<Фрагмент адреси сторінки>”,
item_name: “<Назва міста відправлення – Назва міста прибуття>”,
affiliation: “[назва сервісу]”,
coupon: “<Назва знижки та детали другого квитка, пусто, якщо немає>”,
discount: <Розмір знижки без знаку мінус другого квитка, 0, якщо немає>, index: 1,
item_brand: “<Конкретний перевізник обраного рейсу>”,
item_category: “<Країна відправлення>”,
item_category2: “<Країна прибуття>”,
item_category3: “<Місто відправлення>”,
item_category4: “<Місто прибуття>”,
item_variant: “<Дата та час відправлення та прибуття в структурованому форматі прізвище та ім’я другого пасажира>”,price: <Вартість другого квитку>, quantity: 1
},
] });

Example of corresponding parameter value population:


gtag("event", "purchase", {
transaction_id: "45393919-ed9d-4d2a-a965-8211ec789e23",
currency: "UAH",
value: 3705,
items: [
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
coupon: "За віком: до 6 р. -50% - 2020-02-26",
discount: 1425,
index: 1,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35 ТЕСТ ТЕСТОВИЧ",
price: 1425,
quantity: 1
},
{
item_id: "kharkiv-5054966-wroclaw-5052869",
item_name: "Харьків - Вроцлав",
affiliation: "[назва сервісу]",
coupon: "За віком: до 13 р. -20% - 2014-05-17",
discount: 570,
index: 1,
item_brand: "СТЕЦИК Т.В. ФОП",
item_category: "Україна",
item_category2: "Польша",
item_category3: "Харьків",
item_category4: "Вроцлав",
item_variant: "2024-05-24 21:00 - 2024-05-26 07:35 ТЕСТ 2 ТЕСТОВИЧ 2",
price: 2280,
quantity: 1
}
]
});

P.S. If you have questions regarding this technical task and audit, you can submit a request for a consultation on our agency’s website – https://spilnoagency.com.ua/

Frequently Asked Questions

How can I learn more about this topic?

We recommend exploring other articles on our blog and official documentation. Our content is regularly updated to reflect the latest changes in 2026.

Can I get a consultation?

Yes, you can reach out to our team for a free consultation through the contact form on our website. We’ll help you find the best solution for your business needs.

Are there free tools available?

Most tools described in this article offer free plans or trial versions. Check the pricing section in the article for detailed information.

Редакція Spilno Agency Spilno Agency All articles by author →
← Back to blog