Google Tag Manager

Clarity supports the use of Google Tag Manager (GTM) to update the Clarity tracking code on your website. When you publish your tags through GTM, Clarity automatically updates the tracking code if it needs changing.

Our recommended installation method is quick and doesn't require much knowledge of tag management. However, if something goes wrong, there are a couple of alternative methods you should try if necessary.

Step 1

Go to the Clarity Settings page, select Setup from the left navigation bar, and then select Google Tag Manager. Next, select Connect Now.

Starting the GTM integration.

Clarity's page for Google Tag Manager appears.

Step 2

Sign in to GTM with a Google Account, and complete the verification steps. When Clarity asks for permission to publish with GTM, select Allow to grant permission.

Sign into ???.

Step 3

On the Google Tag Manager panel, two menus containing your accounts and containers (if any) appear. On the Account list, choose an account.

Choose an account.

Note

If you don't have a GTM account, you will need to set one up first and then start again.

Step 4

In the Container menu, select a container.

Select a container.

Note

If you don't have a container, you will need to set one up first.

Step 5

On Google Tag Manager, select the Create and publish button. The setup process is complete, and the Clarity Settings page appears.

GTM setup complete.

Option 2: Install Clarity on GTM (secondary method)

Step 1

Sign in to Google Tag Manager.

Step 2

On Google Tag Manager, select New Tag.

Select a new tag to install.

Step 3

In the name field, give your tag any name. For example, Clarity Tag.

Give your tag a name.

Step 4

Select the Tag Configuration panel.

Configure your tag.

Step 5

On the Choose tag type panel, select the Discover more tags in the Community Template Library option.

Discover tags.

Step 6

On the Import tag template page, search for "clarity", and then choose the option for "Microsoft Clarity - Official".

Choose Microsoft Clarity.

Step 7

On the Template Details page, select Choose template.

Choose template.

Step 8

On the Tag Configuration page, enter your Clarity project ID.

Enter your project ID.

You can find the ID in the project URL in your browser's address bar. For example: https://clarity.microsoft.com/projects/view/"projectid"/

Step 9

On the Choose a trigger panel, select All pages.

Select all pages in trigger panel.

Step 10

The trigger has been added. Review and select Save.

After trigger added, review and select save.

Step 11

On the Submit Changes panel, select Publish.

On Submit Changes panel, select Publish.

Your GTM integration with Clarity is now complete.

Option 3: Install Clarity on GTM (manual setup)

Step 1

Sign in to Google Tag Manager.

Step 2

On Google Tag Manager, select New Tag.

Select a new tag.

Step 3

Name the tag as Clarity Tag, and then select Edit on Tag Configuration.

Give the tag a name.

Step 4

Under Choose tag type, select Custom HTML.

Select a custom HTML tag type.

Step 5

On the Clarity Settings page, copy the Clarity tracking code.

Copy the Clarity tracking code.

Step 6

On the GTM Tag Configuration page, paste the code in the HTML field, and then select Save.

Paste in the code and select Save.

Step 7

In the No Triggers Selected pop-up window, select Add Trigger.

In the No Triggers window, select Add Trigger.

Step 8

On the Choose a trigger page, select All pages.

On the Choose a trigger page, select all pages.

Note

If you don't want to install Clarity on every page of your site, consult the Google Tag Manager documentation for instructions on how to do so.

Step 9

The trigger has been added. Review and select Save.

Review trigger and select save.

The Clarity tracking code is now installed.

Disconnect project from GTM

Follow one of these steps to disconnect Clarity from Google Tag Manager.

Step 1

Go to the Clarity Settings page, and then select Setup from the left navigation bar. Next, select Disconnect project from Google Tag Manager.

Step 2

On the Disconnect this project pop-up window, select Disconnect.

Disconnect.

If you used a different method for installing GTM

Use Google Tag Manager to pause or delete your tags.

Verification

There are two ways to verify if Clarity is running correctly on your website. Check Verification to know more.

FAQ

For more answers, refer to Google Analytics Integration FAQ.

Visit Clarity