Tuan Anh Hoang
Dec 12, 2025
  370
(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
Creating an admin tool - unused assets

Let's make an admin tool to clean unused assets and see how to extend your favorite CMS with custom tools and menues! We will build a tool step by...

Daniel Ovaska | Apr 15, 2026

Running Optimizely CMS on .NET 11 Preview

Learn how to run Optimizely CMS on the .NET 11 preview with a single-line change. Explore performance gains, PGO improvements, and future-proofing...

Stuart | Apr 15, 2026 |

Your Optimizely Opal Is Probably Burning Carbon It Doesn't Need To

Four patterns Optimizely practitioners could be getting wrong with Opal agents: inference levels, oversized tool responses, missing output...

Andy Blyth | Apr 15, 2026 |

Optimizely CMS 13: A Strategic Reset for Content, AI, and Composable Marketing

Optimizely CMS 13 is not just another version upgrade—it represents a deliberate shift toward a connected, AI-enabled, and API-driven content...

Augusto Davalos | Apr 14, 2026

The 74% Problem: Why Most Companies Are Getting AI Wrong

I’ve seen this before… The pattern. The rush, the excitement, the scramble to adopt something new before anyone has stopped to ask what problem it...

Mark Welland | Apr 14, 2026

Scheduled jobs with parameters

Scheduled jobs is an integral part of most Optimizely solution but the UI has, in my opinon, always been lacking in usability and features. Earlier...

Per Nergård (MVP) | Apr 14, 2026