Skip to main content
NewNMC’s advertising guidelines for doctors are in force from 6 Oct 2026. See what to change, and get a free compliance auditNew NMC advertising rules for doctors: what to change
Analytics

GA4 Setup for Hospitals: Event Taxonomy for Departments, Doctors and Appointment Steps

A naming system for GA4 events and parameters that shows which departments, doctors and booking steps lose visitors, without recording symptoms, conditions or anything a patient types.

GA4 Setup for Hospitals: Event Taxonomy for Departments, Doctors and Appointment Steps

Most hospital GA4 properties we are asked to review share one problem: the data is there, but it cannot answer the questions the marketing team asks. Which department's booking form loses the most people at step two? Do visitors who view a consultant profile book more often than those who view only the department page? Is the Hindi version of the form completed less often than the English one? A default install records page views and a few automatic events. It does not record the structure of a hospital.

This article is for marketing leads, web teams and analysts at hospitals and multi-specialty clinics. It sets out an event and parameter naming system that works at department, doctor and booking-step level, and it deliberately stops short of recording anything about a visitor's health. The rules that keep it safe are part of the design, not a footnote.

The examples use a hypothetical 200-bed hospital in Pune with eight departments, about sixty consultants and two campuses. Adapt the vocabulary to your own service lines, but keep the structure.

Decide what the taxonomy must answer

Write the questions first, then design events. For a hospital, a workable list is short:

  • Which departments get traffic, and how much of it reaches a booking form?
  • At which step of the booking form do visitors leave, by department and by device?
  • Which doctor profiles lead to a request, and which are viewed but never lead anywhere?
  • Which entry points (department page, doctor page, health-check package, ad landing page) produce completed requests?
  • How many completed requests become confirmed appointments? That last answer lives in your CRM, not in GA4, and the taxonomy should leave a hook for it.

If an event does not help answer one of these, do not create it. Google's collection limits allow event and parameter names of up to 40 characters and 25 parameters per event, so there is room, but every extra event is something someone must document, test and maintain.

Naming rules

Pick a convention and write it down before the first tag is built.

  • snake_case, verb first for actions: appointment_start, doctor_profile_view, department_cta_click.
  • Names under 40 characters. Google documents 40 characters as the limit for event names and parameter names, and a key event whose name is too long will not be reported as a key event.
  • One event name per behaviour, parameters for the variation. Do not create cardiology_form_start and orthopaedics_form_start. Create appointment_start with a department parameter. Eight departments then cost you one event, not eight.
  • Use Google's recommended names where they exist. Recommended events include generate_lead for a submitted form and qualify_lead for a lead that meets your criteria. Reusing them keeps reports and Google Ads imports predictable.
  • Controlled values. Every parameter that takes a value from a list gets a published list, in lower case, with no free text.

The core event set

This set covers most hospital sites. Parameter names are suggestions; the point is that they are consistent.

EventFires whenParameters
department_viewA department landing page loadsservice_group, campus
doctor_profile_viewA consultant profile loadsdoctor_id, service_group, campus
appointment_startThe visitor first interacts with the booking formform_type, entry_point, service_group
appointment_stepA step is completedstep_number, step_name, form_type
generate_leadThe request is submitted and the server accepts itform_type, entry_point, service_group, language
call_clickA tel: link is tappedclick_location, campus
whatsapp_clickA WhatsApp link is tappedclick_location, campus
qualify_leadSent later, from the CRM, when the enquiry is confirmed as a real appointment requestform_type, entry_point

Two notes. First, generate_lead should fire on a confirmed server response or a thank-you state, not on the button click. A click that triggers a validation error is not a lead. Second, qualify_lead is the bridge to the offline side. Sending it needs a server-side step; the offline conversion tracking post covers how to join a CRM outcome back to a click.

Handling departments without recording conditions

This is the design decision that matters most. A parameter such as department=oncology attached to a visitor who has just opened an appointment form reveals something about that person, even if the form never captured a name. For most departments (dental, orthopaedics, general medicine) a department label is ordinary navigation data. For others it edges toward information about a health condition: oncology, mental health, fertility, HIV and sexual health, addiction medicine.

A practical rule is to use two levels:

  • service_group: a coarse, hospital-defined grouping used in all event parameters. For example heart_vascular, bone_joint, women_children, general_adult, specialist_care.
  • department: the detailed department name, kept out of GA4 for sensitive specialties and held only in your own CRM, where access controls and consent records exist.

Your clinical and legal leads decide which specialties go into the coarse bucket. The marketing team should not make that call alone, and clinical review applies to any wording that implies a diagnosis. Report-level detail for those departments comes from the CRM and from page-level counts.

Never put these in event parameters: symptoms, diagnoses, procedure names chosen in a form, free-text fields, search terms typed into the site search, patient or visit IDs, phone numbers or email addresses. Google's PII guidance says no data may be passed that Google could use or recognise as personally identifiable, and it names user-entered text, site search terms and custom dimensions as places where PII leaks in. The DPDP Act for healthcare marketing explains why that matters for an Indian provider.

Want this applied to your practice? Get a free analytics audit.

Book my free audit

Doctor identifiers

Consultants are professionals, and a doctor profile view is not health data. Use a stable internal identifier, such as doctor_id=d_0142, mapped to the name in a lookup table in your reporting tool. Do not use the doctor's name as the value: names change spelling across languages and create duplicate rows. Also avoid putting doctor_id on the form-submit event if the doctor is selected by the patient; keeping it on the profile-view event answers the profile question without tying a named clinician to a submitted request.

The booking funnel, step by step

Take a typical four-step appointment form: choose campus and department, choose a doctor or "first available", enter contact details, confirm. Map each step to one appointment_step event.

  • Step 1: step_number=1, step_name=choose_service
  • Step 2: step_number=2, step_name=choose_clinician
  • Step 3: step_number=3, step_name=contact_details
  • Step 4: step_number=4, step_name=confirm

Fire the event when the step is completed, not when it is displayed, and fire it once per step per form instance. Then a funnel exploration in GA4 reads the steps in order. Because step_name is a controlled list, you can compare the same step across service_group and device without writing a new event.

Turn off the automatic form events in enhanced measurement if you build this. The enhanced measurement events form_start and form_submit fire on generic form interactions, including a site-search box or a newsletter field, and they will duplicate your own events. Likewise the automatic outbound click event will also record WhatsApp links; make sure the whatsapp_click event is the one you use for reporting.

Register parameters as custom dimensions, selectively

A parameter appears in reports only after it is registered as an event-scoped custom dimension. Registered dimensions are limited per property, so register what you will actually use: service_group, form_type, entry_point, step_name, language, campus. Keep step_number as a custom metric or leave it unregistered if the name is enough. Check the current limit in the GA4 documentation before planning the list.

Document the result in a one-page tracking plan: event, trigger, parameters, allowed values, owner and date added. The plan matters more than the tags. When an agency changes or a developer leaves, it is what stops the taxonomy from drifting.

Testing before you trust it

  • Run each event in GA4's DebugView or in the Tag Manager preview and check names and values against the tracking plan.
  • Submit a test through every form on every campus and confirm generate_lead fires exactly once.
  • Trigger a validation error and confirm no lead fires.
  • Open pages with query strings from campaigns and confirm no personal values appear in page_location.
  • Compare the weekly count of generate_lead with the number of requests logged by your own booking system. A small gap is normal. A large one means a tag is firing in the wrong place or being blocked.

Where to start

If you have to begin with only three things, begin here:

  1. Write the five questions the taxonomy must answer.
  2. Agree the coarse service_group list with clinical and legal leads, and decide which specialties never appear at department level.
  3. Build appointment_start, appointment_step, generate_lead with a tracking plan, test, then add doctor and click events.

For the surrounding work, see our analytics and tracking service, the GA4 glossary entry, and, for the form itself, the guide to accessible appointment forms. WhatsApp entry points are covered separately in click-to-WhatsApp ads for clinics, and listing-driven traffic in the Google Business Profile setup guide. For the wider hospital programme, start with the hospital marketing guide.

Filed underGA4 hospitalGA4 event taxonomyGA4 for hospitalshospital website analyticsGA4 appointment funnelGA4 custom events healthcare

About the author

Co-Founder & CTO · Gurugram, India

Arush builds the systems the rest of the company runs on — the patient-acquisition pipelines, the AI chatbots, the analytics that tie a single click to a booked appointment. If a campaign reports a number, it's because something his team built is tracking it.

Free guide · 17 pages

The Patient Acquisition Blueprint

A 90-day plan from first search to booked appointment.

The Pioneers Brief — one essay, three benchmarks, one teardown, every Thursday. Subscribe free →

Free analytics audit

Your next chapter starts with a conversation.

Three quick questions. We come prepared with a plan for your specialty and city.

  • A 30-minute call with a healthcare specialist
  • Your top three growth opportunities, in writing
  • Honest advice — even if that means not hiring us
  • No obligation and no hard sell
You’ll speak with a senior strategist
Consultations are hosted by Arush Thapar’s team.
Step 1 of 3Takes 30 seconds

What do you want to improve first?

Details stay privateNo obligationReply within 1 working day

Client portfolio · Healthcare websites

Work relevant to ga4 setup for hospitals event taxonomy for departments doctors.

Explore client work →