Google Analytics integration

  • Artikel
  • 5 Minutten ze liesen

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 you need more information on, jump to GA Dashboard to debug and understand user pain points.

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 more 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 Get Started under Google Analytics integration.

Getting started in Google Analytics.

Step 2

You'll be redirected to Google to sign in. Choose an account or enter an email by selecting 'Use another account' and follow the sign-in steps.

Google pop up to sign in.

Sign up for Google Analytics if you haven't already signed up.

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.

Select Save, and you'll 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.

Enter the site's details on What do you want to connect to? dialog box.

  • Friendly name: Your site's name
  • Web Property ID: Your site's Google Analytics property ID. Get help finding the property ID.
  • Dimension ID: Your site's Google Analytics dimension ID. Get help finding the dimension ID.

Activate Google Analytics integration.

Select Continue, and you'll be redirected to the Clarity Setup page.

Deactivating the web property

Toggle the Active button if you wish to disable the GA integration temporarily.

Deactivate Google Analytics integration.

Disconnect Google Analytics integration

Important

Once you disconnect your project, it's removed from your Google Analytics account. You need to redo the installation process to use Clarity.

Step 1

Choose a project and navigate to the 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 customizable description necessary for the best integration with Google Analytics. Use the following instructions for either GA3 or GA4, depending on the 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 go to the ADMIN area.

Look under the Product Linking area for Custom Definitions on the Admin screen and 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. The list will be empty if you haven't set up any dimensions.

Google Analytics New Dimension.

You can either use an existing custom dimension or make a new one. If you're using an existing dimension, jump 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.

Select the link title. For example, select 'Clarity Playback URL'.

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's 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 close Google Analytics.

Step 5

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

Google Analytics Finish setup.

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

Google Analytics Site Connect 2.

Step 6

Enter the dimension ID in the Dimension ID on the dialog box, and 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 on the left bar, go to Events in the Events area.

On the Events screen, select Custom definitions from the left panel.

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.

You can either use an existing custom dimension or make a new one. If you're using an existing dimension, note your Event Parameter name (dimension ID), and jump 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 (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 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