Google Analytics integration

Note

To Start using Clarity, you must finish the Setup process.

Integrating your Clarity project with Google Analytics allows Clarity to put a convenient link to session playbacks within your Google Analytics dashboard. Once you identify the sessions that you need more information on, jumping to Clarity will let you see exactly what your user saw - enabling you to debug and understand pain points for your users.

How does Clarity integration work?

Clarity will create a custom dimension called the 'Clarity Playback URL'. Data will start flowing into Google Analytics from the Clarity JavaScript that you've added to your site without any additional changes from you.

Note

Not all sessions will have a playback URL. Clarity saves your users' bandwidth by only uploading full fidelity playbacks for a subset of page views.

Here are the steps to integrate Google Analytics into Clarity.

Installation

Note

At this point you can only add one web property to integrate with Clarity.

Step 1

Choose a project and navigate to the Settings tab.

Go to Setup and select Getting Started under Google Analytics integration.

Getting started in Google Analytics.

Step 2

You will be redirected to Google to sign in. If you have already signed in, select the account you wish to use or choose Use another account to sign in.

Google pop up to sign in.

If you haven't already signed-up, you'll need to sign up for Google Analytics to continue.

Step 3

On the dialog box, select the web property to which you would like Clarity to send data.

If you see the site in the 'Site to connect' menu

Select the site from the menu and select Save.

Google Analytics web property selection.

Click Save and then you will be redirected to the Clarity Setup page.

If you don't see the site in the 'Site to connect' menu

Select the option to enter your site manually.

Google Analytics add site manually.

On the What do you want to connect to? dialog box, enter the site's details.

Activate Google Analytics integration.

When you are done, click Save and then you will be redirected to the Clarity Setup page.

Deactivating the web property

If at any time you would like to temporarily disable the upload to Google Analytics, you can switch off the Active button.

Deactivate Google Analytics integration.

Disconnect Google Analytics integration

Important

Once you disconnect your project, it will be removed from your Google Analytics account and you need to redo the installation process to use Clarity.

Step 1

Choose a project and navigate to Settings tab.

Go to Setup and select Disconnect project from Google Analytics under Google Analytics integration.

Disconnecting Google Analytics integration selection.

Step 2

Confirm Disconnect on the pop-up window.

Disconnecting Google Analytics integration confirmation.

How to find and add your Google Analytics dimension ID on Google Analytics

When integrating your Clarity site with Google Analytics, specify a dimension ID, a sort of customizable description necessary for best integration with Google Analytics. Use the following instructions for either GA3 or GA4 depending on which version of Google Analytics you use.

How to find and add your Google Analytics dimension ID on Google Analytics 3 (GA3)

Here's how to find your dimension ID on GA3 and add it to your Clarity setup.

Note

If you are using Google Analytics 4 (GA4), skip this section and follow the instructions in the next section

Step 1

Connect to your Google Analytics account, and then go to the Admin area.

On the Admin screen, look under the Product Linking area for Custom Definitions, and then select Custom Dimensions.

Google Analytics Custom Dimensions.

The Custom Dimensions page appears.

Step 2

The Custom Dimensions page features a New Custom Dimension button and a list of all your existing dimensions. If you haven't set up any dimensions, the list will be empty.

Google Analytics New Dimension.

If you already have a custom dimension, Clarity allows you to either use it or to make a new one. If you want to use your existing dimension, skip ahead to Step 3.

To add a custom dimension, select New Custom Dimension. On the dialog box, enter a name of your choice. For example, you can use 'Clarity Playback URL'.

Note

Clarity doesn't care what name you choose, but remember the name because you'll need it soon.

Step 3

On the Custom Dimensions page, you should see your dimension in the list.

Click the link title. For example, click 'Clarity Playback URL' if that is the name you gave to your dimension.

Google Analytics Edit Dimension 1.

The Edit Custom Dimension page appears.

Step 4

On the Edit Custom Dimension page, look at the sample code under JavaScript (Only works for Universal Analytics properties)

The dimension ID is the middle value in single quotes under 'SOME_DIMENSION_VALUE'. It is the name you gave it followed by a number, its index value.

Google Analytics Edit Dimension 2.

Copy the dimension ID so you can paste it later, and then close Google Analytics.

Step 5

Return to Clarity. On the Setup page, scroll to the Google Analytics integration section, and then click Finish setup.

Google Analytics Finish setup.

On the What do you want to connect to? dialog box, where you see Try adding it manually, select manually.

Google Analytics Site Connect 2.

Step 6

On the dialog box, enter the dimension ID in the Dimension ID field, and then select Save.

Google Analytics Dimension ID.

How to find and add your Google Analytics dimension ID on Google Analytics 4 (GA4)

Here are the instructions for finding your dimension ID on GA4.

Note

If you are using Google Analytics 3 (GA3), skip this section and follow the instructions in the previous section.

Step 1

Connect to your Google Analytics account, and then on the left bar go to Events in the Events area.

On the Events screen, select Manage Custom Dimensions near the top of the page.

Google Analytics 4 Manage Definitions.

The Custom Definitions page appears.

Step 2

The Custom Definitions page features a Create custom dimensions button and a list of all your existing dimensions. If you haven't set up any dimensions, the list will be empty.

Google Analytics 4 Custom Definitions.

If you already have a custom dimension, Clarity allows you to either use it or to make a new one. If you want to use your existing dimension, make a note of your Event Parameter name (this is your dimension ID), and then skip ahead to Step 3.

To add a custom dimension, select the Create custom dimensions button. On the Dimensions page, enter an Event Parameter name of your choice (this is your dimension ID). The parameter name must consist of letters, numbers, or underscores, and it must start with a letter. For example, you can use 'Clarity_Playback_URL'.

Note

Clarity doesn't care what name you choose, but remember the name because you'll need it soon.

Step 3

Return to Clarity. On the Setup page, scroll to the Google Analytics integration section, and then select Finish setup.

Google Analytics Finish setup button.

Where you see Try adding it manually, select manually.

Google Analytics Site Connect.

Step 4

Under What do you want to connect to?, enter the dimension ID in the Dimension ID field, and select Save.

Google Analytics Dimension ID.

FAQ

For more answers, refer to Google Analytics FAQ.

Visit Clarity