Published site tracking (Refined, Scroll Viewport)

Copy-paste snippets that add the same tracking to sites published through Refined or Scroll Viewport.


#How it works

The snippet loads Capable's loader script and looks the measurement ID and licence up live, so you never have to re-paste it when the ID changes.


#What it needs

Refined or Scroll Viewport, and permission to add custom HTML/JavaScript in those products.


#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

  • Published Capable Site views can never be attributed to a person. They are always anonymous, with no account type and no guest status.

  • If the Capable Sites cookie consent banner is on and a visitor never clicks Accept, no analytics load on that published site for them at all.

  • In production an unlicensed site collects nothing at all, including from published sites.

  • New network access the app needs must be approved by your Confluence admin in Admin Hub, and the Refined and Scroll Viewport snippets need content security policy changes inside those products.



How it actually behaves.