A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Tuan Anh Hoang
Dec 12, 2025
  272
(2 votes)

CMS Audiences - check all usage

Sometimes you want to check if an Audience from your CMS (former Visitor Group) has been used by which page(and which version of that page)

Then you just need to use my sample SQL query to check the usage of that audience:

CREATE TABLE #TempGUID(ID INT IDENTITY(1,1),VGName VARCHAR(50), VGGuid VARCHAR(36));
 INSERT INTO #TempGUID (VGName,VGGuid) SELECT String01, Guid FROM tblSystemBigTable SBT join tblBigTableIdentity BTI ON SBT.pkId = BTI.pkId  where SBT.StoreName = 'VisitorGroup' ;

 DECLARE @CurrentValue VARCHAR(36);
 DECLARE @CurrentName VARCHAR(50);
 DECLARE @MinID INT = (SELECT MIN(ID) from #TempGUID);
 
 WHILE @MinID IS NOT NULL
 BEGIN
	SELECT @CurrentValue = VGGuid,@CurrentName = VGName FROM #TempGUID WHERE ID = @MinID

	SELECT DISTINCT @CurrentName AS AudienceName,fkContentID AS ContentID,NAME AS ContentName,pkID AS VersionNumber FROM tblWorkContent WHERE pkID IN 
		(SELECT fkWorkContentID FROM tblWorkContentProperty WHERE LongString like ('%'+ @CurrentValue+'%')) 

	DELETE FROM #TempGUID WHERE ID = @MinID;
	SET @MinID = (SELECT MIN(ID) from #TempGUID);
END;

DROP TABLE #TempGUID;

The reult should look like this:

Hope that help!

Dec 12, 2025

Comments

Please login to comment.
Latest blogs
A day in the life of an Optimizely OMVP: Unlock the Power of Unified Search: Introducing Custom Data Management for Optimizely Graph

Bring all your data together in one searchable experience The Challenge: Siloed Data, Fragmented Search Every organisation has data spread across...

Graham Carr | Jan 16, 2026

Alt text is retrieved for images imported from CMP-DAM in Optimizely CMS 12.

Introduction Although image alt text is stored as metadata in CMP/DAM, it is not automatically rendered in browser HTML. This document outlines the...

Deepmala S | Jan 16, 2026

Announcing Stott Security Version 4.0

January 2026 marks the release of Stott Security v4, a significant update to the popular web security add-on for Optimizely CMS 12, with more than...

Mark Stott | Jan 16, 2026

Optimizely Graph Best Practices - Content Modelling and Querying

Introduction With the Mando Group team having worked extensively with Optimizely Graph over the last 12+ months, we have uncovered a number of best...

Jon Williams | Jan 16, 2026