Tuan Anh Hoang
Dec 12, 2025
  307
(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
AEO/GEO: A practical guide

Search changed. People ask AI tools. AI answers. Your content must be understandable, citable, and accessible to both humans and machines. That’s...

Naveed Ul-Haq | Feb 17, 2026 |

We Cloned Our Best Analyst with AI: How Our Opal Hackathon Grand Prize Winner is Changing Experimentation

Every experimentation team knows the feeling. You have a backlog of experiment ideas, but progress is bottlenecked by one critical team member, the...

Polly Walton | Feb 16, 2026

Architecting AI in Optimizely CMS: When to Use Opal vs Custom Integration

AI is rapidly becoming a core capability in modern digital experience platforms. As developers working with Optimizely CMS 12 (.NET Core), the real...

Keshav Dave | Feb 15, 2026

Reducing Web Experimentation MAU Using the REST API

Overview Optimizely Web Experimentation counts an MAU based upon the script snippet rendering for evauluation of web experiement. Therefore when yo...

Scott Reed | Feb 13, 2026