Search tracking (browser side)

Records a search-results event when someone uses Confluence search.


#How it works

The script watches the browser URL for /search paths and reads the search term out of the text, query, q or cql parameter. Ordinary page-view tracking is deliberately skipped on search pages so a search does not count as a page view.


#What it needs

Tracking enabled.


#Where you do it

Task

Where

Open the settings page

Confluence > Settings > Apps > Google Analytics

Set the Measurement ID and start collecting

View tracking panel > Data stream (if connected) or Measurement ID (manual)

Turn on search, comment and page-edit events

Enhanced tracking panel > Measurement Protocol API secret


#Settings that affect this

Setting

Where

What it does

Connect Google Analytics / Disconnect

Settings > Apps > Google Analytics > Connect Google

Starts a Google sign-in popup. The connection is site-level: one admin connects once and the whole Confluence site uses it. Disconnect revokes access at Google and deletes the stored tokens.

Data stream

Settings > Apps > Google Analytics > View tracking

Picking a web data stream fills in the Measurement ID for you.

Measurement ID

Settings > Apps > Google Analytics > View tracking

The GA4 tag ID (G-XXXXXXXXXX). This is the single required setting: nothing is collected anywhere until it is set.


#Worth knowing

  • Anonymous, logged-out readers of public pages ARE tracked, by design, and there is no per-reader opt-out inside Confluence. Their browsers contact both Google and Capable. They are recorded as "anonymous" with no Google user id.

  • Searches can be counted twice on sites where Confluence emits its own search event, because the browser and the server both record one.

  • Data leaves your tenant to two places. To Google: page URL, path and title, space key, page id, type and version, a hashed account id (or "anonymous"), and search terms. To Capable's cloud: your Atlassian cloud id on each cold tracker load, the measurement ID plus licence status, your Google connection tokens, and every report query (including hashed account filters), which is proxied through Capa



How it actually behaves.