What are custom variables
Custom variables (CVARs) are key-value pairs pulled from your website's data layer, that provide context about your website pages, users, or sessions.
Think of custom variables as labels that help you understand:
- What type of page a user is viewing (e.g., homepage, product page, checkout)
- User characteristics (e.g., logged in status, membership level, geographic region)
- Product or content details (e.g., category, brand, product ID, price range)
- Session context (e.g., items in cart, search terms, selected filters)
Where can you use custom variables in Contentsquare
Mappings
Group similar pages together based on custom variable values rather than URLs. This is especially powerful for dynamic websites, single-page applications (SPAs), or sites where URLs don't clearly indicate page type
Learn more about how to use CVARs to create a mapping
Segments
Create targeted user segments to analyze specific populations based on their behavior or characteristics.
Examples include: Page type, customer status, stock status
Learn more about how to define your segments using CVARs
Session Replay
Filter and find specific session replays based on custom variable criteria. View CVAR data directly in the replay player under the metadata bar.
How to setup custom variables
You have three main options for implementing custom variables on Web projects
| Implementation method | Plan availability | Implementation Resources |
| The Contentsquare Tag Configurator (CSTC)* * Recommended method for Pro/Enterprise plans |
Requires Pro or Enterprise plans | CSTC template: Custom variable |
| Add via manual code | Requires Growth, Pro or Enterprise plans | Send custom variables |
| Tag manager | All plans | Send custom variables |
Note:
Setup resources are available to guide you on setting up custom variables. It is up to you and your development team to implement this functionality as it best meets your requirements.