

# Analytics Studio
Analytics Studio

Analytics Studio is a unified web interface for business analysts or data analysts to create and view dashboards, query and explore clickstream data, and manage metadata. 

## Modules
Modules

 Below are the modules included in the Analytics Studio. 
+  **Dashboard**. View the out-of-the-box dashboard and custom dashboards (if any). 
+  **Exploration**. Use advanced analytics models to query clickstream data beyond the out-of-the-box dashboard. 
+  **Analyses**. Create and modify dashboards, as well as manage datasets. 
+  **Data management**. View and manage the metadata for clickstream data. 

## Terms and concepts
Terms and concepts

 This section describes key concepts and terms used in Analytics Studio. 

 **Event**. Clickstream data generated by a user action within an app or website (such as clicking, and visiting a page). 

 **Preset event**. Events that are automatically collected by clickstream SDK, usually with a name starting with an underscore '\$1'. 

 **Custom event**. Events that are defined and collected by an app owner. The collection timing and business purpose of the event varies by apps. 

 **Event parameter**. Event parameters are used to describe the various dimensions of information at the time an event occurred. They fall into two categories: public parameters and private parameters. 

 **Public parameter**. The parameters that all events include, such as user information (user\$1id), and device information (app version, device model, etc.) 

 **Private parameter**. The parameters that are unique to certain events, such as user-customized parameters. 

 **User attribute.**. User attribute is used to record the property of a user. They fall into two categories: preset attributes collected by SDK presets, such as '\$1first\$1visit\$1date'; custom attributes, that is, user attributes reported by the user themselves, such as 'email\$1address'. 

# Dashboard
Dashboard

## Overview
Overview

 Clickstream Analytics on AWS collects data from your websites and apps to create dashboards that derive insights. You can use dashboards to monitor traffic, investigate data, and understand your users and their activities. 

Depends on your pipeline configuration, the time for data to be available in your dashboard varies. By default, the metrics in the out-of-the-box dashboards are calculated on a daily basis, you should see the data and metrics from previous day (according to your app's time zone).

### View dashboards
View dashboards

 Use this procedure to view dashboards: 

1.  Go to **Clickstream Analytics on AWS Console**, in the **Navigation Bar**, choose **Analytics Studio**. 

1.  In the Analytics Studio page that opens, select the project and app you just created in the drop-down list at the top of the web page. 

1.  Choose the **User lifecycle - default** dashboard. 

### Reports
Reports

 The dashboard contains a set of reports throughout the user lifecycle, which aim to help you understand how people use your website or app, from acquisition to retention. 


|  **Report name**  |  **What it is**  | 
| --- | --- | 
|  [Acquisition](acquisition-report.md)  |  Summarizes key metrics about new users, and provides detail view user profile  | 
|  [Engagement](engagement-report.md)  |  Summarizes key metrics about user engagements and sessions  | 
|  [Retention](retention-report.md)  |  Summarizes key metrics about active users and user retentions  | 
|  [Device](device-report.md)  |  Summarizes key metrics about the devices users are using to access your apps and websites, and provides detail view of each device  | 
|  [Details](details-report.md)  | This report allows you to query and view user' attributes and the events the user performed.  | 

### Custom report
Custom report

 If you want to investigate certain pieces of data further, you can write SQL to create views in Redshift or Athena, then add dataset into QuickSight to create visualization. Refer to [this example](custom-report-1.md) to learn how to create a customize report with Redshift. 

**Create Dashboard**

You can create a custom dashboard to save the result of exploration query. Below are the steps:

1.  Select **Create Dashboard** button on the top-left.

1. Fill in a name as **Dashboard name** .

1. Fill in a description for the dashboard.

1. Enter a sheet name, then click on the \$1 button on the right. You can add multiple sheets in one dashboard.

1. You can remove a sheet by click on the X button on the sheet name.

1. Select **Create** button.

1. After the dashboard was created, you can select the dashboard to save query results.

# Acquisition report
Acquisition report

 You can use the acquisition report to get insights into how new users arrive at your website or app for the first time, as well as the sources of everyday traffic. 

**Note**  
This article describes the default report. You can customize the report by applying filters or comparisons or by changing the dimensions, metrics, or charts in QuickSight. For more information, refer to [Visualizing data in Quick](https://docs.aws.amazon.com/quicksight/latest/user/working-with-visuals.html). 

## View the report
View the report

1.  Access the dashboard for your application. Refer to [Access dashboard](dashboards-1.md#view-dashboards).  

1.  In the dashboard, choose the sheet with name of `Acquisition`. 

## Data sources
Where the data comes from

 Acquisition report is created based on the following QuickSight datasets:


|  **QuickSight dataset**  |  **Redshift view / table**  |  **Description**  | 
| --- | --- | --- | 
| User\$1User\$1View-<app>-<project> | clickstream\$1acquisition\$1day\$1user\$1view\$1cnt | This dataset stores data on the number of new users and number of active users on your websites or apps for each day. | 
|  Day\$1Traffic\$1Source\$1User-<app>-<project>  | clickstream\$1acquisition\$1day\$1traffic\$1source\$1user  | This dataset stores data on the number of new users per each traffic source type for each day.  | 
|  Day\$1User\$1Acquisition-<app>-<project>  | clickstream\$1acquisition\$1day\$1user\$1acquisition  | This dataset stores data on the number of new users, number of active users, number of sessions, number of engaged sessions, and number of events per each traffic source type for each day. | 
| Country\$1New\$1User\$1Acquisition-<app>-<project> | clickstream\$1acquisition\$1country\$1new\$1user  | This dataset stores data on the number of new users per each country and city for each day. | 

 

## Dimensions
Dimensions

 TheAcquisition report includes the following dimensions.  


|  **Dimension**  |  **Description**  |  **How it's calculated**  | 
| --- | --- | --- | 
| First user traffic source  | The source of the traffic that acquires new users to your websites or apps (for example, google, baidu, and bing).  | Traffic source is populated from utm parameters in page\$1url (i.e., utm\$1source) or traffic-source preserved attribute (i.e., \$1traffic\$1source\$1source), or derived from referrer url (only for web).  | 
| First user traffic medium  | The medium of the traffic that acquires new users to your websites or apps (for example, organic, paid search)  | Traffic medium is populated from utm parameters in page\$1url (i.e., utm\$1medium) or traffic-source preserved attribute (i.e., \$1traffic\$1source\$1medium), or derived from referrer url (only for web).  | 
| First user traffic campaign  | The name of a promotion or marketing campaign that acquires new users to your websites or apps.  | Traffic campaign is populated from utm parameters in page\$1url (i.e., utm\$1campaign) and traffic-source preserved attribute (i.e., \$1traffic\$1source\$1campaign), or derived from referrer url (only for web).  | 
| First user traffic source / Medium First  | The combination of traffic source and medium that acquires new users to your websites or apps.  | Same as above for traffic source and traffic medium.  | 
| user traffic channel group  | Channel groups are rule-based definitions of the traffic sources. The name of the traffic channel group that acquires new users to your websites or apps.  | Traffic channel group is derived based on the traffic source and medium.  | 
| First user traffic clid platform  | The name of platform for click id (auto-tagging from advertisement platform) that acquires new users to your websites or apps.  | Traffic source clid platform is populated from clid parameter in page\$1url and traffic-source preserved attribute (i.e., \$1traffic\$1source\$1clid\$1platform).  | 
| First user app install source  | The name of app store that acquires new users to your apps, for example, App Store, Google Store.  | App install source is from traffic-source preserved attribute (i.e., \$1app\$1install\$1channel).  | 
| Session traffic source  | The traffic source that acquires users into a new session on your websites or apps (for example, google, baidu, and bing)  | Traffic source is populated from utm parameters in page\$1url (i.e., utm\$1source) or traffic-source preserved attribute (i.e., \$1traffic\$1source\$1source), or derived from referrer url (only for web). | 
| Session traffic medium  | The traffic medium that acquires users into a new session on your websites or apps (for example, organic, paid search)  |  Traffic medium is populated from utm parameters in page\$1url (i.e., utm\$1medium) or traffic-source preserved attribute (i.e., \$1traffic\$1source\$1medium), or derived from referrer url (only for web).  | 
| Session traffic campaign  | The name of a promotion or marketing campaign that acquires users into a new session on your websites or apps.  | Traffic campaign is populated from utm parameters in page\$1url (i.e., utm\$1campaign) and traffic-source preserved attribute (i.e., \$1traffic\$1source\$1campaign), or derived from referrer url (only for web).  | 
| Session traffic Source / Medium  | The combination of traffic source and medium that acquires users into a new session on your websites or apps.  | Same as above for traffic source and traffic medium.  | 
| Session traffic channel group  | Channel groups are rule-based definitions of the traffic sources. The name of the traffic channel group that acquires users into a new session on your websites or apps.  | Traffic channel group is derived based on the traffic-source and medium.  | 
| Session traffic clid platform  | The name of platform for click id (auto-tagging from advertisement platform) that acquires users into new session on your websites or apps.  | Traffic clid platform is populated from clid parameter in page\$1url and traffic-source preserved attribute (i.e., \$1traffic\$1source\$1clid\$1platform).  | 
| Geo country  | The country where users are when they are using your websites or apps. | Geo location information is inferred based on user IP address. | 
| Geo city | The city where the users are when they are using your websites or apps. | Geo location information is inferred based on user IP address.  | 

## Metrics
Metrics

The Acquisition report includes the following metrics:


|  **Metric**  |  **Description**  |  **How it's calculated**  | 
| --- | --- | --- | 
| New users  | The number of users who interacted with your site or launched your app for the first time (event triggered: \$1first\$1open).  | Count distinct user\$1id or user\$1pseudo\$1id (if user\$1id is not available) when event\$1name equals '\$1first\$1open'.  | 
| Active users  | The number of distinct users who triggered any event in the selected time range.  | Count distinct user\$1id or user\$1pseudo\$1id (if user\$1id is not available) at any event  | 
| Sessions  | The number of sessions users created.  | Count distinct session\$1id.  | 
| Engaged Session  | The number of sessions that lasted 10 seconds or longer, or had 1 or more page or screen views. | Count distinct session\$1id if the session is engaged.  | 
| Engaged Rate  |  The percentage of sessions that were engaged sessions.  | Engaged sessions / total sessions.  | 
| Events  | The number of times users triggered an event.  | Count event\$1id | 
| Avg\$1engagement\$1time\$1per\$1user  | The average time per user that your website was in focus in a user's browser or an app was in the foreground of a user's device.  | Total user engagement durations / Number of active users Count distinct user\$1id or user\$1pseudo\$1id (if user\$1id is not available) when event\$1name equals '\$1first\$1open'.  | 

## Sample dashboard
Sample dashboard

Below image is a sample dashboard for your reference.

![\[Dashboard showing user metrics, traffic sources, and geographic data with graphs and charts.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/sample-dash.png)


# Engagement report
Engagement report

You can use the Engagement report to get insights into how users interact with your websites and apps. It shows metrics around user engagement levels, activities performed, and which pages/screens are most visited. 

**Note**  
This article describes the default report. You can customize the report by applying filters or comparisons or by changing the dimensions, metrics, or charts in QuickSight. For more information, refer to [Visualizing data in Quick](https://docs.aws.amazon.com/quicksight/latest/user/working-with-visuals.html). 

## View the report
View the report

1.  Access the dashboard for your application. Refer to [Access dashboard](dashboards-1.md#view-dashboards).  

1.  In the dashboard, choose the sheet with name of `Engagement`. 

## Data sources
Data sources

Engagement report are created based on the following QuickSight datasets:


|  **QuickSight dataset**  |  **Redshift view / table**  |  **Description**  | 
| --- | --- | --- | 
| Engagement\$1KPI-<app>-<project>  | clickstream\$1engagement\$1kpi | This dataset stores data on Engagement KPIs per day. | 
| Day\$1Event\$1View\$1Engagement-<app>-<project>  | clickstream\$1engagement\$1day\$1event\$1view | This dataset stores data on the number of events and number of view events for each day | 
| Event\$1Name-<app>-<project>  | clickstream\$1engagement\$1event\$1name | This dataset stores data on the number of events per event name for each user for each day. | 
| Page\$1Screen\$1View-<app>-<project>  | clickstream\$1engagement\$1page\$1screen\$1view | This dataset stores data on the number of views per each page or screen for each day. | 
| Page\$1Screen\$1View\$1Detail-<app>-<project>  | clickstream\$1engagement\$1page\$1screen\$1detail\$1view | This dataset stores data on the view event per page title/ page url or screen name/screen id for each user for each day. | 

## Dimensions
Dimensions and metrics

 The report includes the following dimensions:


|  **Dimension**  |  **Description**  |  **How it's calculated**  | 
| --- | --- | --- | 
| Event name  | Name of the event triggered by users  | Derived from the event name you set for an event with Clickstream SDK or HTTP API.  | 
| Page title  | Title of the web page | Page title derives from the title tag in your HTML.  | 
| Page URL path  | The path in the web page URL  | Page path derives from the value after the domain. For example, if someone visits www.example.com/books, then example.com is the domain and /books is the page path.  | 
| Screen name  | Title of the screen | Screen name derives from the name you set for a screen using clickstream SDK or HTTP API .  | 
| Screen class  | The class name of the screen | Screen class derives from the class name of the UIViewController or Activity that is currently in focus. | 

## Metrics
Metrics

 The report includes the following metrics:


|  **Metric**  |  **Description**  |  **How it's calculated**  | 
| --- | --- | --- | 
| Avg\$1session\$1per\$1user  | The average number of sessions per active user.  | Total number of sessions / total number of active users  | 
| Avg\$1engagement\$1time\$1per\$1user\$1minute  | The average time per user that your website was in focus in a user's browser or an app was in the foreground of a user's device.  | Total user engagement durations / Number of active users  | 
| Avg\$1engagement\$1time\$1per\$1session\$1minute  | The average time per session that your website was in focus in a user's browser or an app was in the foreground of a user's device  | Total user engagement durations / Number of sessions  | 
| Active users | Number of active users that had page\$1view or screen\$1view events. .  | Count distinct user\$1id or user\$1pseudo\$1id (if user\$1id is not available) when event\$1name is '\$1page\$1view' or '\$1screen\$1view'.  | 
|  Event count  | The number of times users triggered a '\$1page\$1view' or '\$1screen\$1view' event. | Count event\$1id when event\$1name is '\$1page\$1view' or '\$1screen\$1view'.  | 
| Event count per user  |  Average event count per user |  Event count / Active users | 

 

## Sample dashboard
Sample dashboard

Below image is a sample dashboard for your reference.

![\[Dashboard displaying engagement metrics, event data, and page view statistics over time.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/engagement.png)


# Retention report
Retention report

You can use the Retention report to get insights into how frequently and for how long users engage with your website or mobile app after their first visit. This helps you understand how effective your product is at attracting users to return after their initial visit.

**Note**  
This article describes the default report. You can customize the report by applying filters or comparisons or by changing the dimensions, metrics, or charts in QuickSight. For more information, refer to [Visualizing data in Quick](https://docs.aws.amazon.com/quicksight/latest/user/working-with-visuals.html). 

## View the report
View the report

1.  Access the dashboard for your application. Refer to [Access dashboard](dashboards-1.md#view-dashboards).  

1.  In the dashboard, choose the sheet with name of `Retention`. 

## Data sources
Data sources

 Retention report are created based on the following QuickSight dataset: 


|  **QuickSight dataset**  |  **Redshift view / table**  |  **Description**  | 
| --- | --- | --- | 
| User\$1New\$1Return-<app>-<project>  | clickstream\$1retention\$1user\$1new\$1return  | This dataset stores data on the number of new users and number of returning users for each day  | 
| Retention\$1View-<app>-<project>  | clickstream\$1retention\$1view\$1v3  | This dataset stores data on the cohort of user return by their first visit date and days since their first visit.  | 
| Event\$1Overtime-<app>-<project>  | clickstream\$1retention\$1event\$1overtime  | This dataset stores data on daily event counts.  | 
| DAU\$1MAU-<app>-<project>  | clickstream\$1retention\$1dau\$1wau  | This dataset stores the user\$1ids of active users for each day.  | 
| Lifecycle\$1Weekly\$1View-<app>-<project>  | clickstream\$1retention\$1dau\$1wau  | This dataset stores data on the number of new users, number of retained users, number of return users, and number of lost users for each week.  | 

## Metrics
Metrics

 The report includes the following metrics: 


|  **Metric**  |  **Definition**  |  **How it's calculated**  | 
| --- | --- | --- | 
| New users  | The number of users who visited your website or app for the first time.  | Count distinct user\$1id or user\$1pseudo\$1id (if user\$1id is not available) when event\$1name equals '\$1first\$1open'.  | 
| Returning users  | The number of users who have visited your website or app before.  | Count distinct user\$1id or user\$1pseudo\$1id (if user\$1id is not available) when user\$1first\$1visit\$1date does not equal event\$1date.  | 
| Returning rate  | The percentage of users returned over total users in that cohort.  | Returning users / total users.  | 
| Lifecycle - New  | Number of new users in the week.  | Number of users that triggered no events in previous weeks.  | 
| Lifecycle - Retained  | Number of users are active in this week and were active in last week.  | Number of users that triggered events in previous week and this week.  | 
| Lifecycle - Return  | Number of users visited before and were not active in previous week, but are active in this week (excludes new users). | Number of users that triggered events in at least two weeks before and are active in this week.  | 
| Lifecycle - Churn  |  Number of users were active in previous week, but are not active in this week.  | Number of users that triggered events in previous week but triggered no event this week.  | 

## Sample dashboard
Sample dashboard

Below image is a sample dashboard for your reference.

![\[Dashboard displaying user metrics including new and returning users, retention rates, user activity, and stickiness over time.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/retention.png)


# Device report
Device report

 The Device Report provides insights into the devices, operating systems, and browsers used by your app or website users. This data helps you understand your user base and optimize for the most common configurations.

**Note**  
This article describes the default report. You can customize the report by applying filters or comparisons or by changing the dimensions, metrics, or charts in QuickSight. For more information, refer to [Visualizing data in Quick](https://docs.aws.amazon.com/quicksight/latest/user/working-with-visuals.html). 

## View the report
View the report

1.  Access the dashboard for your application. Refer to [Access dashboard](dashboards-1.md#view-dashboards). 

1.  In the dashboard, choose the sheet with name of `Device`. 

## Data sources
Data sources

 Device reports are created based on the following QuickSight dataset: 

 Retention report are created based on the following QuickSight dataset: 


|  **QuickSight dataset**  |  **Redshift view / table**  |  **Description**  | 
| --- | --- | --- | 
| Device-<app>-<project>  | clickstream\$1device\$1user\$1device\$1view  | This dataset stores data on the device information per each user for each day.  | 
| Crash\$1Rate-<app>-<project>  | clickstream\$1device\$1crash\$1rate  | This dataset stores data on the crash rate for each app version for each day. | 

## Dimensions
Dimensions

 The report includes the following dimensions: 


|  **Dimension**  |  **Description**  |  **How it's calculated**  | 
| --- | --- | --- | 
| App version  | The version of the app  | Derived from the app\$1version field automatically collected by Clickstream SDK or manually set by HTTP API.  | 
| Device  | The device name associated with the event.  | For mobile app, it is derived from model\$1name field automatically collected by Clickstream SDK or manually set in HTTP request. For web, it is the device\$1ua\$1device that parsed from User Agent.  | 
| Device screen resolution  | The screen resolution of the device  | Concatenation of screen\$1width and screen\$1height values  | 
| Browser  | The name of the browser  | From the value of device\$1ua\$1browser field which parsed from the User Agent.  | 
| Operating system  | The operating system of the device.  | For mobile app, it is derived from platform field automatically collected by Clickstream SDK or manually set in HTTP request. For web, it is the device\$1ua\$1operating\$1system that parsed from User Agent.  | 
| Operating system version | The operating system version of the device.  | For mobile app, it is derived from os\$1version field automatically collected by Clickstream SDK or manually set in HTTP request. For web, it is the device\$1ua\$1operating\$1system\$1version that parsed from User Agent. | 

## Metrics
Metrics

 The report includes the following metrics: 


|  **Metric**  |  **Definition**  |  **How it's calculated**  | 
| --- | --- | --- | 
| Active users  | Number of active users that had triggered any event. | Count distinct user\$1id or user\$1pseudo\$1id (if user\$1id is not available).  | 
| Crash rate | The percentage of the users experiencing app. | Number of distinct user with '\$1app\$1exception' events / Total active users | 

## Sample dashboard
Sample dashboard

Below image is a sample dashboard for your reference.

![\[Dashboard displaying user analytics across platforms, devices, and app versions with various charts and graphs.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/device.png)


# Details report
Details report

 You can use the Details report to view common and custom dimensions for individual events, query all user attributes for a specific user, and see the events that a particular user has performed 

**Note**  
This article describes the default report. You can customize the report by applying filters or comparisons or by changing the dimensions, metrics, or charts in QuickSight. For more information, refer to [Visualizing data in Quick](https://docs.aws.amazon.com/quicksight/latest/user/working-with-visuals.html). 

## View the report
View the report

1.  Access the dashboard for your application. Refer to [Access dashboard](dashboards-1.md#view-dashboards). 

1.  In the dashboard, choose the sheet with name of `Details`. 

## Data sources
Data sources

 User reports are created based on the following QuickSight dataset: 


| **QuickSight dataset**  |  **Redshift view / table**  |  **Description**  | 
| --- | --- | --- | 
| Event\$1View-<app>-<project>  | clickstream\$1event\$1view\$1v3  | This datasets stores all the raw event data joined with user attributes and session attributes.  | 

### Dimensions
Dimensions

 This report includes all the available dimensions for event, user, and session tables. Please refer to [Data Schema](data-schema.md) for each dimensions. 

### Metrics
Metrics

 This report does not any metrics by default. 

## Sample dashboard
Sample dashboard

Below image is a sample dashboard for your reference.

![\[Dashboard displaying event details, custom parameters, and user attributes with timestamps and IDs.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/details.png)


# Custom report
Custom report

 One of the key benefits of this guidance is that you have complete control over the clickstream data collected from your apps and websites. You have complete flexbility to analyze the data for your specific business needs. This article illustrates the steps of creating a custom report with an example of creating funnel analysis by using Redshift Serverless as analytics engine and QuickSight as reporting tools. 

There are two options to create custom analyses. The following examples will guide you through the detailed steps.

## Option 1- create custom analysis with preset QuickSight dataset
Option 1- create custom analysis with preset QuickSight dataset

The guidance had created a `Event_View-<app>-<project> `dataset which stores all the raw event data, includes both common and custom dimension, joined with user attributes and session attributes in QuickSight, you can use these datasets to create custom analysis based on your specific requirements. 

For example, let's say you have a custom event view\$1item that records when a user views an item's detail page. This custom event has a custom attribute event\$1category to track the promotion spot from which the user came to the item detail page. Now, you want to create a custom analysis that uses a pie chart to show the percentage of each event\$1category that led user to item detail pages. 

1. Go to **Analyze module** in Clickstream Analytics on AWS web console. 

1. Click on **New analysis** in the top-right corner. 

1. Select `Event_View-<app>-<project>` dataset. 

1. Select the **USE IN ANALYSIS** button. 

1. Since the `event_category` is a custom parameter for the view\$1item event, we need to extract it from the `custom_parameters_json_st`r field, which is a JSON string, we can use parseJSON function to extract values from it. Select **\$1 CALCULATED FIELD** button to add a calculated field. 

1. Input **Event Category **as the name for the calculated field, and input parseJson(\$1custom\$1parameters\$1json\$1str\$1, "\$1.event\$1category") as the formula, then select **Save**.

1. In the analysis author console, you can see a new field called Event Category appear in the Data panel. 

1.  In the Visuals panel, click on **\$1 ADD **button, and select Pie chart. 

1. Drag the Event Category field to **GROUP/COLOR**, drag event\$1id to **VALUE**. 

1.  In the Filter panel, add a filter to only include event\$1name equals view\$1item. 

1. Now you should be able to see a bar chart shows the percentage of each event\$1category that led to view\$1item events. 

1. You can format the analysis according to your need then publish it as dashboard.

1. To enable your custom analysis to appear in the Dashboards module of the Clickstream Analytics Studio, you need to add the dashboard into the Shared folder with name of the <project-id>\$1<app\$1id>, which was pre-created by the guidance. After you added the custom dashboard into the Shared folder, it will automatically display in the Clickstream Analytics Studio. 

## Option 2 - create custom view in Redshift and import to QuickSight
Option 2 - create custom view in Redshift and import to QuickSight

### Part 1 - Dataset preparation
Part 1 - Dataset preparation

1.  Open **Redshift Serverless dashboard**. 

1.  Choose the workgroup starting with `clickstream-<project-id>` created by the guidance. 

1.  Choose **Query data**. You will be directed to the Redshift Query Editor. 

1.  In the **Editor** view on the Redshift Query Editor, right click on the workgroup with name of `clickstream-<project-id>`. In the prompted drop-down, select **Edit connection**, and you will be asked to provide connection parameters. Follow this [guide](https://docs.aws.amazon.com/redshift/latest/mgmt/query-editor-v2-using.html) to use an appropriate method to connect. 
**Important**  
Read and write permissions are required for the database (with name as <project-id>) to create custom view or table. For example, you can use Admin user to connect to the cluster or workgroup. If you don't know the password for the Admin user, you can reset the admin password in the Redshift Console. For more information, refer to [Security and connections in Amazon Redshift Serverless](https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-security.html). 

1.  If it is the first time you access the query editor, you will be prompted to configure the account. Choose **Config account** to open query editor. 

1.  Add a new SQL editor, and make sure you selected the correct workgroup and schema. 

1.  Create a new view for funnel analysis. In this example, we used below SQL. 

   ```
   CREATE OR REPLACE VIEW {{schema}}.clickstream_funnel_view as
   SELECT
   platform,
   COUNT(DISTINCT step1_id) AS session_start_users,
   COUNT(DISTINCT step2_id) AS page_view_users,
   COUNT(DISTINCT step3_id) AS scroll_users
   FROM (
   SELECT
       platform,
       user_pseudo_id AS step1_id,
       event_timestamp AS step1_timestamp, 
       step2_id,
       step2_timestamp,
       step3_id,
       step3_timestamp
   FROM
      {{schema}}.clickstream_event_base_view  
   LEFT JOIN (
   SELECT
       user_pseudo_id AS step2_id,
       event_timestamp AS step2_timestamp
   FROM
       {{schema}}.clickstream_event_base_view  
   WHERE
       event_name = '_page_view')
   ON
       user_pseudo_id = step2_id
       AND event_timestamp < step2_timestamp
   LEFT JOIN (
   SELECT
       user_pseudo_id AS step3_id,
       event_timestamp AS step3_timestamp
   FROM
       {{schema}}.clickstream_event_base_view  
   WHERE
       event_name= '_scroll' )
   ON
       step3_id  = step2_id
       AND step2_timestamp < step3_timestamp
   WHERE
   event_name = '_session_start' ) 
   group by
   platform
   ```

1. Go to QuickSight console, choose **Dataset**, and then choose **New dataset**. 

1.  In the New Dataset page, choose **Redshift Manual connect** to add dataset, and fill in the prompted form with the following parameters. 
   +  **Data source name**: clickstream-funnel-view-<project-id> 
   +  **Connection type**: select VPC connections / VPC Connection for Clickstream pipeline <project-id> 
   +  **Database server**: input the endpoint url of the serverless workgroup, which you can find on the workgroup console. 
   +  **Port**: 5439 
   +  **Database name**: <project-id> 
   +  **User name**: name of the user you used to created the custom view in previous steps 
   +  **Password**: password of the user you used to created the custom view in previous steps 

1.  Validate the connection, and then choose **Create data source**. 

1.  Choose the view from Redshift as data source - "**clickstream\$1funnel\$1view**", then 
   +  Schema: select notepad 
   +  Tables: clickstream\$1funnel\$1view 
**Note**  
 When prompted to select Import to SPICE or Directly query your data, select `Directly query your data` for this example. 
   +  Choose **Edit/Preview data** to preview the data. Once you're familiar with the data, choose **PUBLISH & VISUALIZE** at the top-right. 

### Part 2 - Create visulizations in QuickSight
Part 2 - Create visulizations in QuickSight

1.  When prompted, select a layout for your visualization.

1.  Choose "**\$1Add**" at the top-left of the screen then choose "**Add visual**". 

1.  Select a Visual type at the bottom-left of the screen, in this example, select **Vertical bar chart**. 

1.  In the Field wells, select platform as X axis, login\$1user, add\$1button\$1click\$1users, and note\$1create\$1users as Value. 

   Now you can publish this analysis as dashboard or continue to format it. For more information, see [Visualizing data in Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/user/working-with-visuals.html).

### Part 3 - Add the custom dashboard to Analytics Studio
Part 3 - Add the custom dashboard to Analytics Studio

To enable your custom dashboard to appear in the Dashboards module of the Analytics Studio, you need to add the dashboard into the Shared folder with the name of `<project-id>_<app_id>`, which was pre-created by the guidance.

# Exploration
Exploration

 The Exploration module provides a collection of advanced analytics models with flexible and easy-to-use query method, allowing you to derive deeper insights from your clickstream data. 

 When you want to explore the clickstream data in more details, you can use explorations to: 
+  perform ad hoc queries 
+  focus on the most relevant data by using filters on event parameters and user attributes 
+  group metrics by dimension to make it easy to compare 
+  easily switch visualization type and drill down or up into data 
+  view and export summary data into the excel or csv 
+  save the explorative analytics results into a dashboard for share or regular use 

## Access Exploration
Access Exploration

 You can create an ingestion module with the following settings: 

 To access Explorations, follow below steps: 

1.  Go to Clickstream Analytics on AWS Console, in the **Navigation Bar**, choose **Analytics Studio**. 

1.  In the Analytics Studio page that opens, choose **Explorations** in the left navigation panel. 

## How Exploration works
How Exploration works

 Currently, exploration provides 4 analytics models: 


|  **Report name**  |  **Description**  | 
| --- | --- | 
|  [Event Analysis](event-analysis.md)  |  Event analysis is used to study the frequency of certain behavioral events. You can conduct multi-dimensional analysis of user behavior through custom metrics, groupings, filters, and various visual charts.  | 
|  [Funnel Analysis](funnel-analysis.md)  |  Funnel analysis, or conversion analysis, is mainly used to analyze the conversion status of users in a specified process. The model first breaks down the entire process into steps and then counts the conversion rate from each step to the next. It can be used to measure the performance of each step. Common usage scenarios include analyzing registration conversion rates, purchase conversion rates, etc.  | 
|  [Path Analysis](path-analysis.md)  |  Path analysis refers to the distribution of the behavior of a group of users after sorting them in sequential order. It is mainly used to analyze and record the distribution ratio of users between pages or events. For example, check how many customers clicked on the product list after opening the app, how many customers viewed the product detail page after visiting landing page, how many customers searched for the product, etc.  | 
|  [Retention Analysis](retention-analysis.md)  |  Retention analysis supports configuring initial event and returning event to calculate the retention or attrition rate of target user groups. It also supports setting associated attributes for initial event and return event.  | 
| [Attribution Analysis](attribution-analysis.md) | Attribution analysis allows you to understand the importance of different touchpoints for a specific goal in your website and apps. | 

## How to use Exploration
How to use Exploration

 Explorations interface consists of the following components: 

![\[Clickstream Analytics Studio interface with Explore module, filters, and date range selection.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/explore.png)

+  **Analytics Model**. A drop-down list to select or switch analytics model. 
+  **Model Configuration**. Specifies the configurations for the analytics model, such as select event, adding filters. Each model might have different configuration. 
+  **Global Filters**. Filters that apply to all the metrics that defined in the Model Configuration. You can add multiple filters and adjust the filter relationship (i.e., 'And' or 'Or'). 
+  **Grouping**. Group the analytics result by specified parameter's value, make it easy for you can compare the metrics at a dimension. 
+  **Analysis Time Range**. Specifies the time range for the analysis. 
+  **Aggregation Granularity**. Specifies the level of granularity to display metrics, such by day, week, or month. 
+  **Visual Type**. Specifies the chart type of the visualization. 
+  **Save to Dashboard**. Save the exploration analysis 
+  **Result Display Area**. Show visualization and detail data. 
+  **Help Panel**. Display additional helpful info when click "Info" icon. 

# Event Analysis
Event Analysis

 Event analysis is used to study the frequency of certain behavioral events. You can conduct multi-dimensional analysis of user behavior through custom metrics, groupings, filters, and various visual charts. 

## Use cases
Use cases

 Event analysis are commonly used when analyzing user behaviors, for example: 
+  Query on user usage of certain product functions, such as adding favorite, video playback, and view live stream; 
+  Compare different groups of user behaviors, such as the number of logins per country; 
+  Compare different channel's effectiveness, such as sign-up rate per traffic source. 

## Key concept
Key concept
+  **Metric**: perform aggregation on a selected event, such as the number of events, or the number of distinct users generating the event. 

## How to use event analysis
How to use event analysis

1.  Select an event, and select the aggregation method for the metric. 

1.  Add filter to the event by clicking the  icon next to the metric. 

1.  Select an event parameter or user attribute as filter. You can add multiple filters by clicking on the filter icon. You can also configure the filter relationship by choosing AND or OR. 

1.  Repeat above step to add more metric if needed. 

1.  If needed, configure global filter by selecting event parameter or user attributes. Similar to event filter, you can add multiple global filters and configure the filter relationship. 

1.  If needed, configure grouping by selecting an event parameter or user attribute. 

1.  Choose **Query** to start the analysis. 

1.  Adjust the data granularity, such as Daily, Weekly, Monthly, if needed. 

1.  Adjust query time range if needed. 

1.  Choose **Save to Dashboard** to save the analysis to a Dashboard, enter a name, description, and select a dashboard and sheet. 

## Example
Example

 Calculate the daily page views (PV) and active user count (UV) on the web from different countries over the past month, requiring active users to have a session duration of at least 30,000 milliseconds. 

## Steps
Steps

1.  Select the **Event Analysis** model. 

1.  In the left **Define Metrics** area, choose \$1page\$1view as the metric for calculating events and select Event number as the metric type. 

1.  Click the **\$1 Add Event** button to add another metric. Choose \$1app\$1end as the metric for calculating events and select User number as the metric type. 

1.  Click the filter icon to the right of \$1app\$1end to add a event filter condition: 
   +  Filter property: Session / Session duration(msec) 
   +  Operation: >= 
   +  Value: 30000 (the unit of Session duration(msec)  is millisecond) 

1.  Configure a global filter in the right **Filters** area: 
   +  Choose Event preset / Platform  as the filter property. 
   +  Operation: = 
   +  Value: Web 

1.  In the right **Attribute Grouping** area, configure grouping by selecting Geography/Country.

1.  In the time selector at the bottom, choose Past Month and click **OK**. 

1.  Click the **Save to Dashboard** button in the top right corner. In the pop-up dialog, enter: 
   +  Chart Name: PV and UV 
   +  Chart Description: PV and UV on the web over the past month (at least 30 seconds) 
   +  Choose a Dashboard: Select a dashboard. (You need to create a dashboard first. For more information, see [Create dashboard](dashboards-1.md#custom-report).) 
   +  Choose a Worksheet: Select a worksheet. 
   +  Click **OK**. 

 All configurations are shown below: 

![\[Event analysis interface with metrics, filters, and parameter grouping options for clickstream data.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/explore-event-en.png)


# Funnel Analysis
Funnel Analysis

 Funnel analysis, or conversion analysis, is mainly used to analyze the conversion status of users in a specified process. The model first breaks down the entire process into steps and then counts the conversion rate from each step to the next. It can be used to measure the performance of each step. 

## Use cases
Use cases

 Funnel analysis is commonly used when analyzing the following user behaviors: 
+  Analysis of the conversion rate of the key process in a product such as order to purchase rate, and registration completion rate; 
+  Analysis of the conversion rate of promotion such as conversion rate of different in-app promotion spot; 
+  Analysis of marketing channels's effectiveness such as purchase rate of new users brought by different ad campaigns. 

## Key concepts
Key concepts
+  **Metric**: The entity used for funnel analysis, such as event number or user number. 
+  **Funnel**: A funnel is a sequence of events that represents a process. It contains at least two events, and each event represents a step in the funnel. 
+  **Funnel window**: A funnel window refers to the time for the user to complete the entire process. It is considered a successful conversion only when the user completes all the selected steps within the set window period. 

## How to use funnel analysis
How to use funnel analysis

1.  Select a metric type. 

   1.  User number: calculate the number of distinct users passing through the entire funnel. 

   1.  Event number: calculate the number of completions of the entire funnel. 

1.  Configure the funnel window. 

   1.  Custom: you can define any duration as the funnel window. 

   1.  The day: complete the funnel within the same date of the first step. 

1.  Select event for as the step. If needed, choose **\$1Add Step** to add more steps. You can add up to 10 steps. 

1.  Choose the filter button to filter the event. Only the events meeting the filter criterial will be considered as passing through the funnel. You can add multiple filters to one event. 

1.  If needed, configure global filter by selecting event parameter or user attributes. Similar to event filter, you can add multiple global filters and configure the filter relationship. 

1.  If needed, configure grouping by selecting an event parameter or an user attribute. 

**Note**  
The Funnel visualization does not support grouping. If you need to group funnel result, please select bar chart.

1.  If you want to only apply the grouping on the first event, toggle on Apply grouping to first step only. If this option is not selected, the grouping will apply to all the steps in the funnel, which means all the events should have parameter or attributes that used to group. 

1.  Choose **Query** to start the analysis. 

1.  Adjust the data granularity, such as Daily, Weekly, Monthly, if needed. 

1.  Adjust query time range if needed. 

1.  Choose **Save to Dashboard** to save the analysis to a Dashboard. Enter a name, description, and select a dashboard and sheet. 

## Example
Example

 Calculate the conversion rate of users on the web from opening the website -> viewing the product details page -> adding to the shopping cart -> making a payment over the past week. 

1.  Select the **Funnel Analysis** model. 

1.  Choose User number as the metric. 

1.  In the left **Define Funnel** area, choose The Day as the funnel window. 

1.  Choose \$1session\$1start, view\$1item, add\$1to\$1cart, purchase as funnel events. 

1.  Configure a global filter in the right **Filters** area: 
   +  Choose Event preset / Platform as the filter property. 
   +  Operation: = 
   +  Value: Web 

1.  Click **Query**. 

 All configurations are as shown in the image below:  

![\[Clickstream Analytics Studio interface showing funnel analysis configuration with user number metrics and funnel steps.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/explore-funnel-en.png)


# Path Analysis
Path Analysis

Path analysis refers to the distribution of the behavior of a group of users after sorting them in sequential order. It is mainly used to analyze and record the distribution ratio of users between pages or events. For example, you may want to check how many customers clicked on the product list after opening the app, how many customers viewed the product detail page after visiting landing page, how many customers searched for the product. 

## Use cases
Use cases

 Path analysis is commonly used when analyzing user navigation pattern. 
+  Analyze the behavioral path distribution of users after entering the product or arriving at landing page 
+  Analyze the transition steps or screen within a specific processes (such as registration, login, payment) or product modules 

## Key concepts
Key concepts
+  **Metric**: the entity used for path analysis, such as event number or user number. 
+  **Session**: the length of the path analysis session. Only the events happened within the session can form a path, events happened in different path will not be counted in the same path. 
+  **Node**: a node in the path can be an event, a screen, or a page. 
+  **Starting node**: the starting point of the path analysis. 

## How to use path analysis
How to use path analysis

1.  Select a metric type. 

   1.  User number: calculate the number of distinct users passing through the entire path. 

   1.  Event number: calculate the number of completion sof the entire path. 

1.  Configure the session. 

   1.  Session ID: Use the session generated by the SDK as the session for path analysis. Only the events happened with the same session ID could be counted as a path. 

   1.  Custom: you can define any duration as the funnel window. 

1.  Specify the type of node for the path. 

   1.  Event name: use event as a node, for example, \$1page\$1view, screen\$1view. 

   1.  Screen name: use the name of a screen in the App as a node. 

   1.  Screen ID: use the class ID of a screen in the App as a node. 

   1.  Page title: use the page title as a node. 

   1.  Page url: use the page url as a node. 

1.  Set a starting node. The start node will be the first node of the path. Only events happened after the starting node will be counted into the path. 

    a. Show all nodes: display all nodes that follow the starting node.

    b. Show selected nodes: display the selected nodes only, other nodes could be grouped as 'others'.

1.  Select nodes to participate in the analysis. Only nodes selected will be highlighted as nodes in the path. You can add up to 10 nodes. 

1.  Specify if you want to include other nodes in the path. If this option is toggled on, all the nodes that are not selected will be counted and display as "Other" in the path. 

1.  Specify if you want to merge consecutive nodes. If this option is toggled on, nodes that are repeated continuously in the same session will be merged into a single node. 

1.  If needed, configure global filter by selecting event parameter or user attributes. Similar to event filter, you can add multiple global filters and configure the filter relationship. 

1.  Choose **Query** to start the analysis. 

1.  Adjust query time range if needed. 

1.  Choose **Save to Dashboard** to save the analysis to a Dashboard. Enter a name, description, and select a dashboard and sheet. 

## Example
Example

 Calculate the distribution of events triggered by customers on the web after the session starts, focusing on login, registration, product exposure, search, viewing products, adding to cart, starting checkout, and placing an order, as well as all other events. 

1.  Select the **Path Analysis** model. 

1.  Choose User number as the metric. 

1.  Choose Session ID as the session definition. 

1.  Choose Event as the node type. 

1.  In the left **Select Nodes** area, choose \$1session\$1start as the starting node. 

1.  Choose sign\$1up, login, product\$1exposure, search, view\$1item, add\$1to\$1cart, begin\$1checkout, purchase in sequence as path nodes. 

1.  Enable **Include Other Events**. 

1.  Enable **Merge Consecutive Events**. 

1.  Configure a global filter in the right **Filters** area: 
   +  Choose other.platform as the filter property. 
   +  Operation: = 
   +  Value: Web 

1.  Choose **Query**. 

 All configurations are as shown in the image below:  

![\[Path analysis interface with metrics, session definition, node type, and event sequence options.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/explore-path-en.png)


# Retention Analysis
Retention Analysis

 Retention rate is a common metric used to assess the user stickiness for an app or website. Retention means that the user returns to your app or website again some time after they used your app. In addition to the standard retention metrics in the default dashboard, Retention Analysis module allows you to select a start event and returning event to customize a retention or attrition rate of a target user group. 

## Use cases
Use cases

 Retention analysis is commonly used to understand how well your app or website is doing in terms of retaining users. 
+  Calculate new user retention rate to measure the effectiveness of traffic channel; 
+  Calculate the active user retention rate to measure the effectiveness for a promotion campaign; 
+  Compare the repurchase rate for different groups of users to identify the most valuable customers. 

## Key concept
Key concept
+  **Start**: the event indicates that users start using the app or website. 
+  **Revisit**: the event indicates that users returning to the app or website. 
+  **Associated parameter**: Associated parameter are used to keep the value of a parameter consistent between the starting event and the return event. For example, promotion campaign name, page title, or product titles must be the same values for both starting event and return event. 

**Note**  
 The two associated parameter must both have values, and the value types must be consistent. 
+  **Retention Rate**: retention rate refers to the relationship between the number of users who perform the specified starting event on the start date (or week, or month depending on the granularity selection) and the number of the same users who perform the specified returning event on the the return date (or week, or month). 

## How to use retention analysis
How to use retention analysis

1.  Select a **Start** event, you can add filter to the event by clicking the filter icon. 

1.  Select a **Revisit** event, you can add filter to the event by clicking the filter icon. 

1.  If needed, you can toggle on **Associate parameter**, then select parameters for both starting event and return event. 

1.  Repeat above step to add more metric if needed. 

1.  If needed, configure global filter by selecting event parameter or user attributes. Similar to event filter, you can add multiple global filters and configure the filter relationship. 

1.  If needed, configure grouping by selecting an event parameter or user attribute. 

1.  Choose **Query** to start the analysis. 

1.  Adjust the data granularity, such as Daily, Weekly, Monthly, if needed. 

1.  Specify query time range. 
**Note**  
 The start time will be the starting point (i.e., day 0) for the retention analysis, and the retention rate % will be calculated against the number of users who performed the specified starting event on the start date (or week, or month depends on the granularity selection). 

1.  Choose **Save to Dashboard** to save the analysis to a Dashboard. Enter a name, description, and select a dashboard and sheet. 

## Example
Example

 Calculate the retention rate of new customers who downloaded from different app markets on Android one week ago. 

1.  Select the **Retention Analysis** model. 

1.  Choose \$1first\$1open as the start event. 

1.  Choose \$1app\$1start as the return event. 

1.  Configure a global filter in the right **Filters** area: 
   +  Choose Event preset / Platform as the filter property. 
   +  Operation: = 
   +  Value: Android 

1.  In the right **Attribute Grouping** area, configure grouping by selecting Application / App install source.

1.  Click **Query**. 

 All configurations are as shown in the image below: 

![\[Clickstream Analytics Studio interface showing Retention analysis configuration options.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/explore-retention-en.png)


# Attibution Analysis
Attibution Analysis

 Attribution analysis is an analytics technique to assign credit to the touchpoint in user conversion journeys for a conversion goal. It allows you to understand the importance of different touchpoints for a specific goal in your website and apps. 

## Use cases
Use cases

 Attributions analysis are commonly used when analyzing the contribution of specific touchpoints, for example: 
+ Identify the most important promotion slots within an app/website in terms of their contribution to a purchase goal; 
+  Identify the most important traffic channels for an app/website based on the contribution to a conversion goal. 

## Key concept
Key concept
+  **Conversion goal:** A quantifiable metric that the app owner wants to achieve, e.g., number of purchase, purchase value, registration user number.
+  **Touchpoint**: Events that app owner designed in the user journey to drive user towards the conversion goal, e.g., page\$1view, product exposure, button\$1click.
+  **Attribution models**: Attribution models are a set of rules or data-driven algorithms used to determine how conversions are assigned to touchpoints on the conversion path. There is no one-fits-all model, choose one base on your scenario. Clickstream Analytics on AWS supports the following models:    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/attribution-analysis.html)

## How to use attribution analysis
How to use attribution analysis

1.  Select an event and metric as conversion goal, you can add filter. Metric types includes: 

   a. Event number: number of conversion times 

   b. SumGroup: sum a value from a numerical parameter that are associated with the event selected as conversion goal 

1. Select touchpoints events, you can add filter(s) to each touchpoint. 

1. Click on Query to start calculation 

1. You can change the time range or attribution model according to your need, which will automatically re-run the query. 

1. Analysis result is displayed in a table with the following columns: 

   a. Touchpoint Name: The touchpoint event name for attribution. 

   b. Total Trigger Count: Number of times the touchpoint has been triggered within the specified conversion window. 

   c. Number of Triggers with Conversion: Within the conversion window, number of time the touchpoint occurred simultaneously with the conversion goal. 

   d. Contribution (number/sum...value): The contribution value of this touchpoint attributed to the conversion goal based on the selected model. 

   e. Contribution Rate: After calculating through the attribution model, the percentage contribution of this touchpoint to the overall total. The calculation logic is the conversion goal metrics under the current attributed event divided by the sum of all conversion goals. 

1. If needed, you can toggle on Associate parameter, then select parameters for both starting event and return event. 

1. Repeat above step to add more metric if needed. 

1. If needed, conﬁgure global ﬁlter by selecting event parameter or user attributes. Similar to event ﬁlter, you can add multiple global ﬁlters and conﬁgure the ﬁlter relationship. 

1. If needed, conﬁgure grouping by selecting an event parameter or user attribute. 

1. Choose Query to start the analysis. 

1. Adjust the data granularity, such as Daily, Weekly, Monthly, if needed. 

1. Specify query time range. 

## Example
Example

 Calculate the retention rate of new customers who downloaded from different app markets on Android one week ago. 

1.  Select the **Attribution Analysis** model. 

1.  Choose purchase as the conversion event, choose sumGroup by [event]value as conversion metric

1. Choose The day as conversion window.

1. Select view\$1live as touchpoint event, add filter of live\$1id = live\$11.

1.  Repeat step 4 to add touchpoints for the rest of three live channel.

1.  Click **Query** .

 All configurations are as shown in the image below: 

![\[Attribution analysis interface with multiple dropdown menus and input fields for data analysis.\]](http://docs.aws.amazon.com/solutions/latest/clickstream-analytics-on-aws/images/attribution.png)


# Analyses
Analyses

 Analyses module allows you to create and modify dashboards based on the clickstream datasets in a drag-and-drop approach. It provides greater flexibility for users to create business-specific metrics and visualizations. You can use the module to: 
+  create dashboard that are not provided in preset dashboard or not supported by explorations. 
+  make changes to the custom dashboard saved from exploration analysis, such as adding calculation fields to calculate custom metrics, adjust visual types etc. 
+  join clickstream data with external datasets, such as adding item master data to enrich clickstream datasets. 

## Access Analyses
Access Analyses

 To access Analyses, follow below steps: 

1.  Go to **Clickstream Analytics on AWS Console**, in the **Navigation Bar**, click on "**Analytics Studio**", a new tab will be opened in your browser. 

1.  In the Analytics Studio page, click the **Analyses** icon in the left navigation panel. 

## How it works
How it works

 Analyses module is essentially the author interface of QuickSight, in which you have the admin access to all the QuickSight functionalities, for example, create analysis, add or manage datasets, publish and share dashboards. 

**Note**  
 Only the user with Administrator or Analyst role can access this module. 

The guidance automatically added the following datasets for each project and app, which contains all fields of event, user, and session tables, making it easy for you do custom analysis. 


|  **Dataset name**  |  **Description**  | 
| --- | --- | 
|  Event\$1View\$1app\$1name\$1project\$1name  |  Event data that includes all public event parameters  | 

 To create a custom analysis, you can follow below QuickSight documentation to prepare data and create visualization: 

1.  [Connecting to data](https://docs.aws.amazon.com/quicksight/latest/user/working-with-data.html) 

1.  [Preparing data](https://docs.aws.amazon.com/quicksight/latest/user/preparing-data.html) 

1.  [Visualizing data](https://docs.aws.amazon.com/quicksight/latest/user/working-with-visuals.html) 

# Data management
Data management

 Data Management helps you manage your clickstream data. This module provides the following features:

1. Matadata management. The guidance automatically scans the data in your clickstream database to generate metadata, allowing you to view names and descriptions of events, event parameters, and user attributes, as well as update their display names, descriptions, and data dictionaries.

1. Traffic source configuration. You can update the traffic source categorization rules in this tab.

## Access Data Management
Access Data Management

 Follow below steps: 

1.  Go to **Clickstream Analytics on AWS Console**, in the **Navigation Bar**, choose **Analytics Studio**. 

1.  In the Analytics Studio page that opens, choose **Data Management** in the left navigation panel. 

**Note**  
 Only the user with Administrator or Analyst role can modify the metadata, such as display name, description. 

## Metadata management
Metadata management

The guidance automatically scans clickstream data to generate metadata and then stored them in Redshift on a daily basis. There are three types of metadata: 
+ **Event**: metadata describes clickstream events. 
+ **Event Parameter**: metadata describes clickstream event parameters. 
+ **User Attribute:** metadata describes user attributesBelow tables list all the dimensions included in each type of the metadata. 

## Metadata dimensions
Metadata dimensions

 Below tables list all the dimensions included in each type of the metadata. 

**Event** 


|  **Dimension name**  |  **Description**  | 
| --- | --- | 
|  Event name  |  The name of the event reported from SDK  | 
|  Display name  |  The display name of the event. By default, it is the same as Event name, user can customize the display name.  | 
|  Description  |  The description name of the event reported from SDK. User can customize the display name. For the event automatically collected by the clickstream SDK, the guidance has pre-populated description  | 
|  Source  |  Describe how the event was collected, Preset indicates the event is automatically collected by SDK, Custom indicates the event is defined and collected by app owner  | 
|  Platform  |  Describe which platform the event was collected from, i.e., from Android, Web or iOS  | 
|  Data volume last day  |  Describe how much data was collected in last day (in UTC timezone)  | 
|  SDK version  |  Describe the version of the SDK that collected the event  | 
|  Associate preset parameters  |  The preset event parameters associated with the event  | 
|  Associate custom parameters  |  The custom event parameters associated with the event  | 

** Event parameters **


|  **Dimension name**  |  **Description**  | 
| --- | --- | 
|  Parameter name  |  The name of the event event parameter reported from SDK  | 
|  Display name  |  The display name of the event parameter. By default, it is the same as Parameter name, user can customize the display name.  | 
|  Description  |  The description name of the event parameter reported from SDK. User can customize the display name. For the event automatically collected by the clickstream SDK, the guidance has pre-populated description  | 
|  Source  |  Describe how the event parameter was collected, Preset indicates the event parameter is automatically collected by SDK, Custom indicates the event parameter is defined and collected by app owner  | 
|  Data type  |  Describe the data type of the event parameter value, e.g., int, string,  | 
|  Associate event  |  The event that the event parameters associated with.  | 
|  Dictionary  |  The unique value for the event parameters, user can customize the display value.  | 

** User attribute **


|  **Dimension name**  |  **Description**  | 
| --- | --- | 
|  Attribute name  |  The name of the user attribute reported from SDK  | 
|  Display name  |  The display name of the user attribute. By default, it is the same as Attribute name, user can customize the display name.  | 
|  Description  |  The description name of the user attribute reported from SDK. User can customize the display name. For the user attribute automatically collected by the clickstream SDK, the guidance has pre-populated description  | 
|  Source  |  Describe how the event parameter was collected, Preset indicates the user attribute is automatically collected by SDK, Custom indicates the user attribute is defined and collected by app owner  | 
|  Data type  |  Describe the data type of the user attribute value, e.g., int, string,  | 

## Update event display name and description
Update event display name and description

1.  Click on the **Events** page, select any event, for example, view\$1item. 

1.  Click on the column labeled **Display Name**, enter a name, such as View Product Details, and then click confirm. 

1.  Go back to Exploration, and in the filter dropdown, you can see view\$1item now displayed as View Product Details. 

 Follow the same steps to update display name and description for Event Parameters and User Attributes. 

## Customize data dictionary for Event Parameter values
Customize data dictionary for Event Parameter values

1.  Click on the **Event Properties** page, and in the search box, select an event parameter, such as \$1entrances. 

1.  The detailed information for the property should open automatically, choose the **Dictionary** page. 

1.  Click on the column labeled **Display Value**, enter a new value, such as Non-First Entry for 0, and enter First Entry for 1, then click confirm. 

1.  Go back to Exploration, and in the filter dropdown, you can see \$1entrances displayed as Non-First Entry and First Entry. 

 Follow the same steps to customize data dictionary for User Attributes values. 

## Traffic source
Traffic source

Traffic source describes the channel through which the users arrive at your website or application, such as paid ads, marketing campaigns, search engines, and social networks. This article describes how the guidance collects and processes traffic-source data.

**Traffic-source data fields **

Traffic source includes the following key dimension to describe how the users arrives at your website or app.:

1. Source - where the traffic originates ( e.g., google, baidu, bing) 

1. Medium - the methods by which users arrive at your site/app (medium, e.g., organic, cpc/ppc, email). 

1. Campaign - the specific marketing efforts you use to drive that traffic (e.g., campaign, creative format, keywords). 

1. Auto-tagged Click ID - the parameter generated and appended by ad platform automatically when ad are showed and clicked. (e.g., gclid). 

   Clickstream Analytics on AWS uses below dimensions and fields to track traffic-source data when sending events. 


|  **Dimension**  |  **Clickstream SDK preserved attributes** | **UTM parameters in page\$1url (Web only)** | **Field in data schema** | 
| --- | --- | --- | --- | 
| Source  | \$1traffic\$1source\$1source  | utm\$1source  | traffic\$1source\$1source  | 
| Medium  | \$1traffic\$1source\$1medium  | utm\$1medium  | traffic\$1source\$1medium  | 
| Campaign Name  | \$1traffic\$1source\$1campaign  | utm\$1campaign  | traffic\$1source\$1campaign  | 
| Campaign ID  | \$1traffic\$1source\$1id  | utm\$1id  | traffic\$1source\$1id  | 
| Campaign Term  | \$1traffic\$1source\$1term  | utm\$1term  | traffic\$1source\$1term  | 
| Campaign Content  | \$1traffic\$1source\$1content  | utm\$1content  | traffic\$1source\$1content  | 
| Auto-tagged Click ID  | \$1traffic\$1source\$1clid  | (\$1)clid  | traffic\$1source\$1clid  | 
| Auto-tagged Click ID Platform | \$1traffic\$1source\$1clid\$1platform  | N/A  | traffic\$1source\$1clid\$1platform  | 
| App Install Source  | \$1app\$1install\$1channel | N/A  | app\$1install\$1source  | 

Below two dimensions are enriched from above traffic-source data fields and added to each event


|  **Dimension**  |  **Field in data schema** | **Description** | 
| --- | --- | --- | 
| Source Category  | \$1\$1traffic\$1source\$1category | Categories based on traffic\$1source\$1source and referral domain, including Search, Social, Shopping, Video, and Internal | 
| Channel Group  | \$1traffic\$1source\$1channel\$1group | A channel group is a set of channels, which are rule-based categories of your traffic sources, for example, paid search, paid social. | 

## Processing
Processing

During data processing, traffic-source field values are populated into dimension values for each event and attributed to users and sessions. Below describes the details steps. 

**Step 1 - Extract traffic-source data **

1. If the preset traffic-source attributes are set with values, data process module will map their values them into corresponding traffic-source data fields. For example, map the value of \$1traffic\$1source\$1source to traffic\$1source\$1source field. 

1. (For web only) If the preset traffic-source attributes have no values, data processing module will map the utm\$1parameters (e.g., utm\$1source) and auto-tagged click id in the page\$1url fields into corresponding traffic-source data fields. For example, map the value of utm\$1source to traffic\$1source\$1source field. 

1. (For web only) If the source dimension are still blank after above steps, data processing module will check if there is value in page\$1view\$1latest\$1referrer field, and look up source value from the Source Category mapping table based on the domain of the referrer, if no source is matched, it will use the top-level domain name as the value of the traffic\$1source\$1source dimension. 

**Step 2 - Derive source category** 

Data processing module uses a Source Category mapping table (to classify the source into different categories (i.e., search, shopping, video, social). For example, source with values of "google" or "bing" will be classified into Search category.

**Step 3 - Derive channel group**

Data processing module uses a set of predefined rules to categorize the traffics into different groups (e.g., direct, paid search, organic search) based on the key traffic-source dimensions (mainly the source. medium, and campaign).

**Step 4 - Populate traffic source dimensions for user and session tables**

While process the traffic-source for each event, the data processing module populate traffic source dimension for each user and session.

1. **User:** If there are traffic-source data in the first meaningful events (e.g., first\$1open, page\$1view, app\$1start, app\$1end) for the first time user visit your website or apps, those traffic-source dimension will be assigned to corresponding user traffic-source attributes, i.e., first\$1traffic\$1source, first\$1traffic\$1medium.

1. **Session:** When user initiate a new session, the data processing module derives traffic-source dimension for the session from the traffic-source dimensions of the first meaningful events in the session (e.g., first\$1open, page\$1view, app\$1start, app\$1end).

## Configurations
Configurations

Clickstream Analytics on AWS allows you to configure the channel group rules and source category mapping to customize the traffic source processing to meet your analytics needs.

**Channel group definitions and rules**

Below are the default channel groups and the rules that the guidance uses to categorize the traffic:


|  **Order**  |  **Channel** | **Description** | **Evaluation rules** | 
| --- | --- | --- | --- | 
| 1 | Direct | Direct is the channel by which users arrive at your site/app via a saved link or by entering your URL. | 1. traffic\$1source\$1category, traffic\$1source\$1source,traffic\$1source\$1medium,traffic\$1source\$1campaign,traffic\$1source\$1content,traffic\$1source\$1term/\$1,traffic\$1source\$1campaign\$1id,traffic\$1source\$1clid are all blank/(not set), (none) AND 2. latest\$1referrer is blank | 
| 2 | Paid Search | Paid Search is the channel by which users arrive at your site/app via ads on search-engine sites like Bing, Baidu, or Google. | 1. traffic\$1source\$1category is Search AND (2. traffic\$1source\$1medium matches regex ^(.cp.\$1ppc\$1retargeting\$1paid.\$1)\$1 OR clid is not none/blank). | 
| 3 | Organic Search | Organic Search is the channel by which users arrive at your site/app via non-ad links in organic-search results. | 1. traffic\$1source\$1category is Search AND (2. medium is blank or none or exactly matches organic). | 
| 4 | Paid Social | Paid Social is the channel by which users arrive at your site/app via ads on social sites like Facebook and Twitter. | 1. traffic\$1source\$1category is Social AND 2. traffic\$1source\$1medium matches regex ^(.*cp.*\$1ppc\$1retargeting\$1paid.\$1)\$1 OR clid is not none/blank. | 
| 5 | Organic Social | Organic Social is the channel by which users arrive at your site/app via non-ad links on social sites like Facebook or Twitter. | 1. traffic\$1source\$1category is Social OR 2. traffic\$1source\$1medium is one of ("social", "social-network", "social-media", "sm", "social network", "social media") | 
| 6 | Paid Video | Paid Video is the channel by which users arrive at your site/app via ads on video sites like TikTok, Vimeo, and YouTube. | 1. traffic\$1source\$1category is Video (i.e., traffic\$1source\$1source OR latest\$1referrer\$1host matches a list of video sites ) AND (2. traffic\$1source\$1medium matches regex ^(.*cp.*\$1ppc\$1retargeting\$1paid.\$1)\$1 OR clid is not none/blank). | 
| 7 | Organic Video | Organic Video is the channel by which users arrive at your site/app via non-ad links on video sites like YouTube, TikTok, or Vimeo. | 1. traffic\$1source\$1category is Video OR 2. traffic\$1source\$1medium matches regex ^(.video.)\$1. | 
| 8 | Paid Shopping | Paid Shopping is the channel by which users arrive at your site/app via paid ads on shopping sites like Amazon or ebay or on individual retailer sites. | 1. traffic\$1source\$1category is Shopping AND (2. traffic\$1source\$1medium matches regex ^(.*cp.*\$1ppc\$1retargeting\$1paid.*)\$1**OR clid is not none/blank* *OR traffic\$1source\$1campaign matches regex ^(.*(([\$1^a-df-z]\$1^)shop\$1shopping).\$1)\$1). | 
| 9 | Organic Shopping | Organic Shopping is the channel by which users arrive at your site/app via non-ad links on shopping sites like Amazon or ebay. | 1. traffic\$1source\$1category is Shopping OR 2. traffic\$1source\$1campaign matches regex ^(.*(([\$1^a-df-z]\$1^)shop\$1shopping).*)\$1 . | 
| 10 | Paid Other | Paid Other is the channel by which users arrive at your site/app via ads, but not through an ad identified as Search, Social, Shopping, or Video. | 1. traffic\$1source\$1category is none AND 2. traffic\$1source\$1medium matches regex ^(.*cp.*\$1ppc\$1retargeting\$1paid.\$1)\$1. | 
| 11 | Email | Email is the channel by which users arrive at your site/app via links in email. | 1. traffic\$1source\$1source contains "mail" OR 2. traffic\$1source\$1medium contains "mail" OR 3. latest\$1referrer\$1host start with "mail". | 
| 12 | SMS | SMS is the channel by which users arrive at your site/app via links from text messages. | 1. traffic\$1source\$1source exactly matches sms OR 2. traffic\$1source\$1medium exactly matches "sms" . | 
| 13 | Audio | Audio is the channel by which users arrive at your site/app via ads on audio platforms (e.g., podcast platforms). | 1.traffic\$1source\$1medium exactly matches audio | 
| 14 | Mobile Push Notifications | Mobile Push Notifications is the channel by which users arrive at your site/app via links in mobile-device messages when they're not actively using the app. | 1. traffic\$1source\$1medium ends with "push" OR 2.traffic\$1source\$1medium contains "mobile" or "notification" . | 
| 15 | Referral | Referral is the channel by which users arrive at your site via non-ad links on other sites/apps (e.g., blogs, news sites). | 1. latest\$1referrer is not none AND traffic\$1source\$1category is none AND 2. latest referrer\$1host is not Internal Domain . | 
| 16 | Internal | Traffic from specified internal domain. | 1. latest\$1referrer\$1host is one of the Internal domains. | 
| 17 | Unassigned | Traffic that can not be assigned to a channel group. | All others | 

To create and edit channel group, go to the Data Management > Traffic Source tab > Channel group. 

1. Create a new group. 
   + Click on the Add new group button. 
   + Fill in the Group name, Description, and Condition. 
   + Click on Reorder, adjust the evaluation sequence to by clicking on the Upper arrow or Down arrow, then click the Apply. 

   2. Edit a channel group 
   + Select a channel group 
   + Click the action button, and select View details 
   + Update the channel group then click on Confirm. 
   + Click on the Reorder 
   + Adjust the sequence of the channel group by clicking on the Upper arrow and Down arrow. 
   + Click Apply to save the order. 

**Source category mapping table** 

Clickstream Analytics on AWS uses a source category mapping table to classify some known sources into the categories of Search, Social, Shopping, and Video. You can also add Internal category for the traffic source coming from internal source. Below are the description for the columns in the mapping table. 


|  **Column**  |  **Description**  | Example | 
| --- | --- | --- | 
| Domain | The host name of the referral URL.  | google.com, baidu.com  | 
| Source name | The name for the traffic source.  | google, baidu  | 
| Category | Category for the source.  | Search, Shopping, Social, Video, and Internal  | 
| Keyword pattern | The keyword parameter name in the referral url, only for Search domain.  | q, query, keyword  | 

To create and edit source category, go to the Data Management > Traffic Source tab > Source category.

1. Create a new category. 
   + Click on the Add new category button. Or you can select an existing category, then click on Action>Copy to new.
   + Fill in the Domain, Source name, and Category.
   + If it is Search, fill in keyword pattern, you can add multiple.
   + Click on Confirm

   2. Edit a channel group 
   + Select a category record
   + Click the action button, and select View details
   + Update the record then click on Confirm.