I'll start with my apologize for creating so trivial tutorial. But even the most trivial tutorial can be helpful for someone. I myself have spent a while in searching for a way to accomplish this.
Acquiring Analytics ID
The first step is to get analytics ID for your Confluence website. You can get one at analytics.google.com.
Deploying Analytics Script
Once you've got analytics ID and analytics script you need to embed, you need to configure Confluence:
- Go to Confluence Administration, then select "Custom HTML" (under "Look and Feel" section);
- Click "Edit" button;
Paste your Google Analytics script in "At end of the HEAD" field, like this:
Well, that's it!