Adobe Experience Platform allows you to ingest data from Adobe Analytics report suites using Experience Data Model (XDM) fields to populate datasets. This analytics data is modified to conform to the XDM ExperienceEvent class. Query Service can then make use of this data by running SQL queries to generate valuable insights from a user’s behavior over the digital platforms.
This document provides a variety of sample SQL queries that demonstrate common use cases when creating insights from web and mobile Analytics data.
See the Analytics field mappings documentation for more information on ingesting and mapping analytics data.
Getting started
For each of the following use cases, a parameterized SQL query example is provided as a template for you to customize. Provide parameters wherever you see { }
in the SQL examples for the dataset, eVar, event, or time frame you are interested in evaluating.
Objectives
The following examples show SQL queries for common use cases to analyze your Adobe Analytics data.
Generate the visitor count for every hour on a given day
SELECT Substring(from_utc_timestamp(timestamp, 'America/New_York'), 1, 10) AS Day,
Substring(from_utc_timestamp(timestamp, 'America/New_York'), 12, 2) AS Hour,
Count(DISTINCT enduserids._experience.aaid.id) AS Visitor_Count
FROM {TARGET_TABLE}
WHERE TIMESTAMP = to_timestamp('{TARGET_YEAR}-{TARGET_MONTH}-{TARGET_DAY}')
GROUP BY Day, Hour
ORDER BY Hour;