Forum Discussion

MarkSHU's avatar
MarkSHU
Copper Contributor
Dec 04, 2023

Microsoft Clarity

Hi,

I'm trying to connect specific SPO sites to a Microsoft Clarity project using the script below, but it is not connecting up. Can anyone advise on the correct script please. We do not want to connect the whole tenant.

 

1. Add Clarity App to site - Site Contents > Add App > Clarity

2. Connect-SPOService -url https://domain.sharepoint.com

3. Connect-PnPOnline -URL https://domain.sharepoint.com/sites/staffhome -UseWebLogin
4. Add-SPOSiteCollectionAppCatalog -Site https://domain.sharepoint.com/sites/staffhome

5. Add-PnPCustomAction -ClientSideComponentId "7f8fd1f2-9d26-4a4a-a607-bf4622d7ec11" -Name "Microsoft Clarity" -Title "Microsoft Clarity" -Location ClientSideExtension.ApplicationCustomizer -ClientSideComponentProperties: '{"clarityID":"123456789"}' -Scope site

 

We have changed the specific project ClarityID.

 

Thanks, Mark

2 Replies

    • MarkSHU's avatar
      MarkSHU
      Copper Contributor
      Hi, but we do not want to deploy for all sites - we want to create a number of individual campaigns with targeted communication and learning pages. I am trying to establish the correct scripts to achieve this, reference the example on the original post.

      Thanks, Mark

Resources