Skip to main content
Skip table of contents

Configuration • Server / Data Center

Using Confluence Cloud? See Configuration Overview for the cloud version instead.

We recommend that you have multiple users within Google Analytics who have administrator permissions on the Google Analytics property.

Create a shared users for both Google Analytics and Google Cloud Platform with administrator access and document how to access those shared user accounts in a page within your Confluence system.

If your original Confluence administrator leaves the company, then you will still be able to access your Google Analytics property and data.

In order to sign into your Google Analytics account from your Confluence instance (at your own web address), you have to setup and configure a Google Cloud Platform project (step 1 in the video). This is not a trivial task, but every step is shown in the video below.

If your company does not use Google Workspace, then follow the steps at My company does not use Google Workspace, now what? to create an organization within Google Cloud Platform.

If you are moving from a previous version of this app, please complete all the configuration steps afresh.

If you migrate to the cloud version of Confluence, step 1 is not required, as it is taken care of by the SaaS version of the Google Analytics in Confluence app.

Prerequisites

Before you begin, you will need the following:

  • A Google Analytics account

  • A Google Cloud Platform account (likely the same as the Google Analytics account)

After installing Google Analytics in Confluence on your Confluence Server instance, you will see a Google Analytics menu item at the top of the page. Select this, and then select Configure from the action menu.

This displays the Google Analytics in Confluence configuration screen.

Configuration is broken down into 4 steps which we will walk through now.

Step 1: Create and configure a new Google Cloud Project

In Step 1, we Create and configure a new Google Cloud Project.

Click on the link to Google Cloud Platform, and login if you have not already.

Create a new project

Select Create Project from the Manage resources screen.

Enter Atlassian Confluence as the project name, select an organisation as required, the click on the Create button.

Your project takes a few seconds to be created. When done, click on Select Project.

Enable the APIs

We now need to enable the Google Analytics API.

Click on the Hamburger menu in the top left corner

From the resulting menu, select APIs & Services:

Then press the + Enable APIs and Services button:

Search for Google Analytics Data API and select the Google Analytics Data API from the dropdown…

On the next screen, select Google Analytics Data API

Press the Enable button:

Press the Hamburger menu and select Enabled APIs and services

Then press the + Enable APIs and Services button:

Search for Google Analytics Admin API and select the Google Analytics Admin API from the dropdown

On the next screen, select Google Analytics Admin API

Press the Enable button:


Press the Hamburger menu and select Enabled APIs and services

Then press the + Enable APIs and Services button:

Search for Google People API and select the Google People API from the dropdown

On the next screen, select Google People API

Press the Enable button:

OAuth consent screen

Press the Hamburger menu and from APIs and services, select OAuth consent screen

On the OAuth consent screen, select the user type of Internal and click the Create button.

Next, add the app info. Using Atlassian Confluence as the app name and your own support email.

Add a suitable logo., such as this one:

Add your own Developer contact information as this is the person who Google will contact if needed with details of any changes to the service.

Having successfully filled in the correct information, click the Save and Continue button.

OAuth Scopes

Press the Add or Remove Scopes button:

Type Google Analytics in the filter field and hit enter.

Select

  • Google Analytics Admin API `../auth/analytics.readonly`

  • Google Analytics Data API `../auth/analytics`

Press the Update button:

Press Save and Continue:

Click on Add or remove scopes and select the ../auth/analytics.readonly scope for Analytics Reporting API and the ../auth/userinfo.profile scope.

Scroll down and click the Update button.

Scroll down and click the Save and Continue button.

OAuth Credentials

Select Credentials from the left hand menu, then click on the +Create Credentials button

Select OAuth client ID from the dropdown.

Select Web application from the Application type dropdown.

Add a suitable name.

Then click on the + Add URI button in Authorized JavaScript origins.

In another browser window, jump back to Confluence and copy the Authorized JavaScript origins from the Configuration screen. This is normally the base URL of your Confluence instance.

Note: If an incorrect URL is specified here, then you will not be able to authenticate with Google in Step 3 below.

Note that Authorized JavaScript origins are only accepted in the format protocol://hostname so for this web server, we would use https://dsapps.atlassian.net without a trailing slash and without any paths

✅ Valid examples:

  • https://confluence.yourdomain.com

  • https://yourconfluenceserver.com

❌ Invalid examples:

  • confluence.yourdomain.com – missing https:// protocol

  • https://confluence.yourdomain.com/ – trailing slash is not allowed

  • https://confluence.yourdomain.com/an/example/path/ – trailing slash and path not allowed

Paste the value from your clipboard and then click on the + Add URI button in Authorized redirect URIs.

Jump back to Confluence and copy the Authorized redirect URIs from the Configuration screen.

The Authorized redirect URIs value should be in this format:

https://confluence.yourdomain.com/plugins/servlet/dsapps/googleanalytics/oauth2/callback where https://confluence.yourdomain.com is the base URL of your Confluence instance.

Paste the value from your clipboard and then click on the Create button.

From the pop up, copy the value of Client ID and Client secret. Do not share these with anyone.

Jump back to Confluence and paste the values from your clipboard into the Google OAuth credentials Client ID & Client Secret fields in the Configuration screen, and click the Save button.

Step 2: Create and configure a new Google Analytics Web Property

In Step 2, we create and configure a new Google Analytics Web Property.

Click on the link to Google Analytics, and login if you have not already.

Select Admin from left hand menu, then + Create Property in the Property section.

Add the Confluence Website URL and select Create a Google Analytics 4 property only.

Don’t forget to give your property a Property name, and selecting a Reporting time zone, before clicking on the Next button.

Select a Business size and check one of the options about how you intent to use Google Analytics, then click on the Create button.

Step 3: Authorize with Google Analytics & select a website profile

In step 3, we authorize with Google Analytics & select a property.

In the Google Analytics in Confluence configuration screen, click on the G Sign in button.

A new window appears where you can sign into Google. Add your email address and login, or select an account, then click on the Allow button on the next screen.

The window closes and your Google Analytics details are populated into the dropdown menus in the Select a Website Profile section.

Select the correct Google Analytics Property and Data Stream from the dropdown and click on the Save button.

Step 4: Configure Custom Dimensions

In step 4, we Configure Custom Dimensions.

In the Custom dimensions for this web property section, you can see whether the Google Analytics custom dimensions have been configured correctly, with some advice on what to change.

If you see any red crosses, press the Update Custom Dimensions in Google Analytics button.

The app will now create all the required custom dimensions in Google Analytics, and green checkmarks will begin to appear next to individual custom dimensions.

If all custom dimensions are now showing green checkmarks, congratulations, you have successfully concluded the configuration.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.