GTM Documentation

Medio's online appointment booking system now has GA4 and GTM integration.

The attached data is entered into the DataLayer at the following events:

Choice of specialty / specialist

dataLayer.push({'event': 'cleanup','ecommerce': null});
dataLayer.push({
'event': 'select_item',
'ecommerce': {
  'items': [{
    'item_name': 'Dr. Minta Ágnes', // Specialty / Doctor's name
    'item_id': '302194', // specialty ID / doctor ID, string
    'item_category': 'Specialist', // Specialist's selector
/ Specialist selector
    'index': 1 // Position in the list, integer
}]

Examination list after choosing a field of expertise

The following code is executed when the list of examinations belonging to the specialty is displayed. If the test has a custom price, the price parameter will not be sent, but the value of the custom_price parameter will be true.

dataLayer.push({'event': 'cleanup','ecommerce': null}); dataLayer.push({ 'event': 'view_item_list', 'ecommerce': { 'currency': 'HUF', // Pénznem 'items': [{ 'item_name': 'Kapilláris mikroszkópia , bőrgyógyászati alapvizsgálattal együtt', // Vizsgálat neve 'item_id': '43622', // Vizsgálat ID, string 'item_category': 'Gyermek bőrgyógyászat', // Szakterület neve 'price': '43900.00&#39 ;, // Test price, double 'custom_price': false, // If custom price then true, otherwise false 'index': 1 }, {Next test}] } });

Exam selection

If the user clicks on the selected test, the following code will be executed:

dataLayer.push({'event': 'cleanup','ecommerce': null}); dataLayer.push({ 'event': 'select_item', 'ecommerce': { 'currency': 'HUF', 'items': [{ 'item_name': 'Kapilláris mikroszkópia, bőrgyógyászati alapvizsgálattal együtt', 'item_id': '43622', 'item_category': 'Gyermek bőrgyógyászat', 'price': '43900.00', 'custom_price': false, 'index': 1 }] } });

Time selection page

When the user arrives at the interface listing appointments for the doctor/specialty, the following code is executed:

dataLayer.push({'event': 'cleanup','ecommerce': null}); dataLayer.push({ 'event': 'view_item', 'ecommerce': { 'currency': 'HUF', 'items': [{ 'item_name': 'Kapilláris mikroszkópia, bőrgyógyászati alapvizsgálattal együtt', 'item_id': '43622', 'item_category': 'Gyermek bőrgyógyászat', 'item_category2': 'Kapilláris mikroszkópia, bőrgyógyászati alapvizsgálattal együtt', 'price': '43900.00', 'custom_price': false, 'doctor_id': '168159' // Doctor ID, string }, {Next doctor}] } });

After choosing a date

If the user selects an available time, the following code is executed:

dataLayer.push({'event': 'cleanup','ecommerce': null}); dataLayer.push({ 'event': 'add_to_wishlist', 'ecommerce': { 'currency': 'HUF', 'items': [{ 'item_name': 'Kapilláris mikroszkópia, bőrgyógyászati alapvizsgálattal együtt', 'item_id': '43622', 'item_category': 'Gyermek bőrgyógyászat', 'item_category2': 'Kapilláris mikroszkópia, bőrgyógyászati alapvizsgálattal együtt', 'price': '43900.00', 'custom_price': false, 'doctor_id': '168159', 'item_variant': '2023-02-17T09:00:00+00:00', // Időpont, ISO8601 'location': &#39 ;Institution name' // Location }] } });

Reserve button

When the user starts the commit process, the following code is executed:

dataLayer.push({'event': 'cleanup','ecommerce': null}); dataLayer.push({ 'event': 'add_to_cart', 'ecommerce': { 'currency': 'HUF', 'items': [{ 'item_name': 'Kapilláris mikroszkópia, bőrgyógyászati alapvizsgálattal együtt', 'item_id': '43622', 'item_category': 'Gyermek bőrgyógyászat', 'item_category2': 'Kapilláris mikroszkópia, bőrgyógyászati alapvizsgálattal együtt', 'price': '43900.00', 'custom_price': false, 'doctor_id': '168159', 'item_variant': '2023-02-17T09:00:00+00:00', 'location': 'Intézmény neve' } ] } });

Personal data

If the user fills in the information required for the reservation, the following code will be executed:

dataLayer.push({'event': 'cleanup','ecommerce': null}); dataLayer.push({ 'event': 'begin_checkout', 'is_registered': true, // If the user had prior registration then true, otherwise false 'ecommerce': { 'currency': ': ': ' , 'items': [{ 'item_name': 'Kapilláris mikroszkópia, bőrgyógyászati alapvizsgálattal együtt', 'item_id': '43622', 'item_category': 'Gyermek bőrgyógyászat', 'item_category2': &#39 ;Kapilláris mikroszkópia, bőrgyógyászati alapvizsgálattal együtt', 'price': '43900.00', 'custom_price': false, 'doctor_id': '168159', 'item_variant': '2023-02-17T09: 00:00+00:00', 'location': 'Institution name' }] } });

Successful appointment booking

If the user finalizes his appointment and it is entered as a successful reservation in Medio, the following code is executed:

dataLayer.push({'event': 'cleanup','ecommerce': null}); dataLayer.push({ 'event': 'purchase', 'ecommerce': { 'currency': 'HUF', 'value': '43900.00', // Végösszeg adótartalommal, double ' tax': 0.00, // Adótartalom vagy 0.00 double 'transaction_id': '375a111f-4bab-4ec1-b7f6-f77bf84bdb0b', // Tranzakció ID 'coupon': '', // Kuponkód vagy üres string &#39 ;affiliation': 'Medio', // A jelenlegi érték 'items': [{ 'item_name': 'A vizsgálat neve', 'item_id': '43622', 'item_category': ' Gyermek bőrgyógyászat', 'item_category2': 'Kapilláris mikroszkópia, bőrgyógyászati alapvizsgálattal együtt', 'price': '43900.00', 'custom_price': false, 'doctor_id': '168159', 'item_variant&#39 ;: '2023-02-17T09:00:00+00:00', 'location': 'Institution name' }] } });

Appointment cancellation

If the user cancels the appointment online, the following code is executed:

dataLayer.push({'event': 'cleanup','ecommerce': null}); dataLayer.push({ 'event': 'refund', 'ecommerce': { 'transaction_id': '375a111f-4bab-4ec1-b7f6-f77bf84bdbT3b' });

Change date

When changing a date, we must first submit a refund event, then a new purchase event, with the same transaction id as the first one, with the modified item_variant parameter.

Get in touch with us!

Content

en_GBEnglish