Set up Site Search Analytics
In order for your visitors' Confluence search queries to appear in your Google Analytics Console, you'll have to perform the following settings in your Google Analytics Admin Console:
- In GA4, site search is automatically tracked as view_search_results event. To see the search term and the category parameters in your reports, you have to create custom dimensions for them (See https://support.google.com/analytics/answer/10075209?hl=en). Create a custom dimension for each parameter:
Event parameter: searchTerm
Event parameter: text_ancestor
Event parameter: text_contributors
Event parameter: text_labels
Event parameter: text_spaces
Event parameter: text_type

You can see the site search events with the categories in the realtime view, but in your event report you can see a "not set" value during the first 48 hours after its creation.