Add Google Analytics to a published Confluence site
To add Google Analytics to a Confluence site published with Capable Sites, open the site's Settings, choose Integrations, paste your GA4 measurement ID (it starts with G-) into Google Analytics ID and select Save changes. Then run Update and Promote. Every published page then sends page views to your Google Analytics property.
#Before you start
You need to be a Confluence admin or a collaborator on the site.
Find your measurement ID in Google Analytics under Admin > Data Streams.
The Google Analytics macro on a Confluence page does not run on a published site. Use this setting instead.
#Steps
Open Capable, choose Sites, open your site, and select Settings, then the Integrations card.
Under Analytics, paste your ID into Google Analytics ID, such as
G-XXXXXXXXXX.Optionally, turn on Capable analytics integration to see published page views in Capable's Google Analytics reports beside the same pages' views in Confluence.
If you need visitors' consent first, turn on Cookie consent popup.
Select Save changes.
On the site's Overview, select Update, wait for it to finish, then select Promote.
Open the live site and check your visit in the Google Analytics Realtime report.
#If it does not work
No visits show up. The setting only reaches the live site after Update and Promote. Check you promoted after saving.
Some visitors are missing. With the cookie banner on, Google Analytics waits for a visitor to allow Analytics. Visitors who reject it are not counted.
The site is protected. Analytics still works for signed-in visitors. The sign-in page itself is not tracked.
#Related
Integrations and cookie consent
Every integration and how consent gates it.
Add a cookie consent banner to a Confluence site
Ask visitors before analytics loads.
Use Google Tag Manager with a published Confluence site
Run GA and other tags from a container.
Analytics, cookies and consent
More analytics and consent guides.
Paste the ID, publish, watch the visits arrive.
