Contentsquare Metrics API + Contentsquare Raw Data API
Get More from Contentsquare: Combine Metrics and Raw Data for Sharper Digital Experience Analysis
Connect Contentsquare's aggregated Metrics API with its granular Raw Data API to build end-to-end analytics pipelines, enrich reporting, and make better UX decisions.


Why integrate Contentsquare Metrics API and Contentsquare Raw Data API?
Contentsquare's Metrics API and Raw Data API are two complementary parts of the same digital experience intelligence platform — one delivers high-level aggregated performance indicators, the other exposes granular, session-level behavioral data. When you connect them on tray.ai, teams can correlate macro trends with individual user journeys, moving from 'what is happening' to 'exactly why it's happening' without switching tools or manually stitching exports. This pairing matters most for data engineering, analytics, and product teams who need an automated, unified view of digital experience data flowing into warehouses, dashboards, or downstream AI models.
Automate & integrate Contentsquare Metrics API & Contentsquare Raw Data API
Use case
Metric-Triggered Raw Data Deep Dives
When the Metrics API surfaces a significant drop in conversion rate or engagement score for a specific page or zone, automatically trigger a targeted Raw Data API pull to extract the individual session replays and event sequences behind the anomaly. This removes the manual step of cross-referencing dashboards and exporting session files. Teams get anomaly context delivered directly to their analytics environment within minutes of detection.
Use case
Unified Digital Experience Data Warehouse Ingestion
Build a fully automated ETL pipeline that periodically pulls aggregated metrics across pages, devices, and segments from the Metrics API, then enriches each record with corresponding raw session and event data from the Raw Data API before loading everything into a centralized data warehouse. This creates a single source of truth for digital experience data that BI tools like Tableau, Looker, or Power BI can query directly. No more siloed exports or inconsistent metric definitions across teams.
Use case
A/B Test Performance Validation and Session Evidence Collection
When an A/B or multivariate test concludes, automatically fetch variant-level performance metrics from the Metrics API and pull the corresponding raw user session data from the Raw Data API to validate statistical results with behavioral evidence. Winning variants get backed by qualitative session-level patterns, not just numbers. Results and supporting session samples can be automatically pushed to a Slack channel, Confluence page, or product management tool.
Use case
Personalization Engine Data Feed
Power real-time or near-real-time personalization platforms by combining zone-level engagement metrics from the Metrics API with individual user behavioral signals extracted from the Raw Data API. The integrated workflow maps high-performing content zones identified in aggregate metrics to the specific user cohorts and session patterns most associated with those engagements. This enriched dataset feeds directly into personalization engines, CDPs, or recommendation systems for more accurate targeting.
Use case
Page Performance Regression Monitoring and Alerting
Schedule recurring Metrics API polls to track core UX KPIs — scroll rate, click rate, hesitation rate, exposure rate — across priority pages. When a metric crosses a defined threshold, automatically pull a batch of raw session records from the Raw Data API that show the regression in action, then route the packaged alert to the right team via email, Slack, or PagerDuty. The result is a fully automated regression detection and triage system.
Use case
Customer Journey Segmentation and Cohort Analysis
Use the Metrics API to identify high-value or underperforming user segments based on aggregated journey metrics, then automatically extract the full raw session event streams for those cohorts from the Raw Data API for deeper journey mapping and funnel analysis. The resulting enriched cohort datasets can be loaded into analytics platforms, customer journey mapping tools, or machine learning pipelines. This workflow replaces manual segment-by-segment data extraction that can take analysts days to complete.
Use case
Executive and Stakeholder Reporting Automation
Automatically compile weekly or monthly digital experience performance reports by pulling high-level KPI summaries from the Metrics API, enriching findings with illustrative session-level data points from the Raw Data API, and formatting the results into structured reports delivered to stakeholders via email, Google Slides, or a BI dashboard refresh. This eliminates the hours analysts spend manually compiling reports from multiple Contentsquare views.
Get started with Contentsquare Metrics API & Contentsquare Raw Data API integration today
Contentsquare Metrics API & Contentsquare Raw Data API Challenges
What challenges are there when working with Contentsquare Metrics API & Contentsquare Raw Data API and how will using Tray.ai help?
Challenge
Coordinating Pagination and Rate Limits Across Two APIs Simultaneously
Both the Contentsquare Metrics API and Raw Data API have their own rate limits, pagination schemes, and quota constraints. When workflows call both APIs in sequence or in parallel — especially for large date ranges or high-traffic sites — it's easy to hit limits on one API while the other is still processing. The result: incomplete data pulls, failed jobs, and inconsistent datasets that need manual remediation.
How Tray.ai Can Help:
tray.ai's workflow engine natively handles pagination loops, retry logic with exponential backoff, and conditional branching to manage rate limit responses (HTTP 429) from each API independently. Workflows can be configured to queue and throttle requests to each API according to their specific limits, so you get complete, consistent data extraction without writing custom engineering to manage it.
Challenge
Joining and Reconciling Different Data Schemas
The Metrics API returns pre-aggregated, structured metric objects keyed by page, segment, and time period, while the Raw Data API returns flat event and session records with their own field taxonomy. Joining these two datasets meaningfully — for example, correlating a zone's click rate metric with the raw click events behind it — requires careful schema mapping and transformation logic that's error-prone when done manually in scripts or spreadsheets.
How Tray.ai Can Help:
tray.ai's visual data mapper and JSONPath transformation tools let teams define reusable field mapping logic that reconciles the two schemas without writing custom code. Transformation steps can normalize keys, compute derived fields, and produce a unified output schema ready for loading into a data warehouse or downstream tool, with the mapping logic version-controlled and auditable.
Challenge
Managing Large Raw Data Volumes Without Overloading Downstream Systems
The Raw Data API can return very large volumes of session and event records, especially when pulling data for high-traffic pages over extended time windows. Piping the full raw data output directly into downstream systems like databases, Slack, or email can overwhelm those targets, cause timeouts, or exceed payload limits — dropping data or breaking workflows entirely.
How Tray.ai Can Help:
tray.ai workflows can include intermediate buffering, batching, and filtering steps that process Raw Data API responses in manageable chunks before passing them downstream. Conditional logic can sample, summarize, or prioritize records based on Metrics API findings, so only the most relevant raw data reaches each downstream system in appropriately sized payloads.
Challenge
Keeping Scheduled Pipelines Resilient to API Downtime or Schema Changes
Production ETL pipelines that depend on both Contentsquare APIs are doubly exposed to disruption. If either API goes down, returns unexpected fields, or changes its response schema, the entire pipeline can fail silently or push corrupted output into data warehouses and reports before anyone notices.
How Tray.ai Can Help:
tray.ai has built-in error handling, alerting, and workflow monitoring that detects failures at each individual API call step and notifies the responsible team immediately. You can add schema validation steps to catch unexpected response structures before they propagate downstream, and failed workflow runs can be replayed from the point of failure once the API issue is resolved — without re-running steps that already succeeded.
Challenge
Securing and Governing Access to Sensitive Session-Level Data
Raw session data from the Contentsquare Raw Data API can contain sensitive behavioral information about individual users. When automated pipelines move this data into warehouses, BI tools, or third-party platforms, organizations need to manage credentials securely, handle data in compliance with GDPR and other privacy regulations, and govern who can access session-level data across those workflows.
How Tray.ai Can Help:
tray.ai stores all API credentials in an encrypted secrets vault with role-based access controls, so Contentsquare API keys are never exposed in workflow configurations or logs. Workflows can apply anonymization, field filtering, or aggregation steps to raw session data before it leaves the integration layer, supporting privacy-by-design principles and reducing the compliance risk of automated data pipelines.
Start using our pre-built Contentsquare Metrics API & Contentsquare Raw Data API templates today
Start from scratch or use one of our pre-built Contentsquare Metrics API & Contentsquare Raw Data API templates to quickly solve your most common use cases.
Contentsquare Metrics API & Contentsquare Raw Data API Templates
Find pre-built Contentsquare Metrics API & Contentsquare Raw Data API solutions for common use cases
Template
Metric Anomaly Detection with Auto Raw Data Enrichment
Polls the Contentsquare Metrics API on a scheduled basis to detect KPI anomalies across defined pages or segments. When an anomaly threshold is crossed, automatically queries the Raw Data API for session records matching the affected time window and segment, then packages and routes the enriched alert to Slack or email.
Steps:
- Schedule a recurring tray.ai workflow to poll the Metrics API for engagement, conversion, or interaction KPIs across target pages
- Evaluate returned metric values against configurable thresholds using tray.ai's built-in data mapping and conditional logic
- On threshold breach, construct a targeted Raw Data API query scoped to the anomalous segment and time window
- Parse and summarize the returned raw session records to identify common behavioral patterns
- Deliver a formatted alert containing both the metric anomaly details and session-level evidence to Slack, email, or a ticketing system
Connectors Used: Contentsquare Metrics API, ContentSquare Raw Data API
Template
Nightly Contentsquare Data Warehouse ETL Pipeline
Runs a nightly ETL workflow that extracts aggregated metrics from the Metrics API across all tracked pages and segments, then fetches corresponding raw session data from the Raw Data API for the same period, joins and transforms the datasets, and loads the unified records into a data warehouse such as Snowflake, BigQuery, or Redshift.
Steps:
- Trigger the workflow on a nightly schedule via tray.ai's time-based trigger
- Call the Metrics API to retrieve all page and segment metrics for the previous day, paginating through results as needed
- Call the Raw Data API to pull session and event records for the same date range, handling rate limits and pagination
- Transform and join metric and raw session records using tray.ai's data mapping tools to produce a unified schema
- Load the combined dataset into the target data warehouse table, logging row counts and errors for monitoring
Connectors Used: Contentsquare Metrics API, ContentSquare Raw Data API
Template
A/B Test Results Package Builder
Automatically fetches variant-level performance metrics from the Metrics API when a test concludes, retrieves supporting raw session samples from the Raw Data API for each variant, and compiles a structured test results package delivered to a Confluence page, Google Doc, or project management tool.
Steps:
- Trigger the workflow via webhook when an A/B test is marked as complete in your experimentation platform
- Query the Metrics API for variant-level engagement and conversion metrics for the test duration
- Query the Raw Data API for a representative sample of raw sessions per variant to gather behavioral evidence
- Format the combined results into a structured summary document using tray.ai's data transformation capabilities
- Publish the completed report to Confluence, Notion, or Google Docs and notify the product team via Slack
Connectors Used: Contentsquare Metrics API, ContentSquare Raw Data API
Template
Real-Time Personalization Data Feed Sync
Combines zone-level engagement metrics from the Metrics API with raw user behavioral event data from the Raw Data API to generate enriched user intent signals, then pushes the processed dataset to a CDP, personalization platform, or recommendation engine on a defined schedule.
Steps:
- Schedule the workflow to run at the desired personalization refresh interval (e.g., hourly or daily)
- Pull zone-level interaction metrics from the Metrics API to identify high-engagement content areas and segments
- Fetch raw session event streams from the Raw Data API for the user cohorts tied to those high-engagement zones
- Transform and merge the metric and event data into a unified user intent profile schema
- Push the enriched profiles to the target personalization platform, CDP, or data store via API or webhook
Connectors Used: Contentsquare Metrics API, ContentSquare Raw Data API
Template
Weekly Executive Digital Experience Report Automation
Generates a weekly digital experience performance report by combining KPI summaries from the Metrics API with curated session insights from the Raw Data API, then distributing the formatted report to stakeholders via email or BI dashboard update.
Steps:
- Trigger on a weekly schedule every Monday morning to cover the previous week's data
- Query the Metrics API for top-level KPIs including bounce rate, conversion rate, engagement score, and zone interaction rates across priority pages
- Identify the top metric movers (positive and negative) and query the Raw Data API for illustrative session records supporting each finding
- Compile the metric summaries and session insights into a structured report template using tray.ai's data mapping
- Distribute the finished report via automated email to stakeholder distribution lists and trigger a BI dashboard data refresh
Connectors Used: Contentsquare Metrics API, ContentSquare Raw Data API
Template
Page Regression Alert with Session Evidence Package
Monitors core page performance metrics via the Metrics API after each deployment and, on detecting a regression, automatically pulls raw session data from the Raw Data API to package contextual evidence and routes a prioritized alert to engineering and UX teams.
Steps:
- Trigger the workflow via webhook from the CI/CD pipeline upon each production deployment
- Poll the Metrics API for key page health metrics in the post-deployment window (e.g., 30-minute and 2-hour checks)
- Compare current metric values against pre-deployment baselines stored in tray.ai's workflow state or an external store
- On regression detection, query the Raw Data API for sessions on the affected pages during the post-deployment window
- Assemble and route a prioritized alert containing the metric delta and sample session IDs to PagerDuty, Slack, or Jira
Connectors Used: Contentsquare Metrics API, ContentSquare Raw Data API