# Custom queries and reference for the Engagement Explore

Use the Engagement Explore to analyze the performance of your campaigns.

You can get metrics and other information about all the events associated with a message, like [Tag](https://www.airship.com/docs/reference/glossary/#tag) and [Attribute](https://www.airship.com/docs/reference/glossary/#attributes) changes and [Custom Events](https://www.airship.com/docs/reference/glossary/#custom_event). Data returned is at the user level.

<p>Data availability depends on your <a href="https://www.airship.com/docs/reference/feature-packages/#data">Performance Analytics plan</a>.</p>

## Navigation

To access to the Explore:

1. Go to **Reports**, then **Performance Analytics**.
1. Select the folder icon (
), then **Shared**.
1. Under **Looks**, select **Explore Glossary** (**Explore Glossary EUCS** for EU customers).
1. Select **Engagement**, then **Navigate to Explore**.

<p>For a list of all Explores in the glossary, see <a href="https://www.airship.com/docs/guides/reports/analytics/exploring/exploring/#predefined-explores">Predefined Explores</a> in <em>Exploring Performance Analytics data</em>.</p>

## Field categories

<p>The sidebar lists categories for various filters, [Dimensions](https://www.airship.com/docs/reference/glossary/#pa_dimension), and [Measures](https://www.airship.com/docs/reference/glossary/#pa_measure) you can use to explore your data. To see their definitions, hover over an item, then select the &ldquo;i&rdquo; icon (
).</p>

Field categories in the Engagement Explore:

<div class="table-scroll-wrapper">
<table width="100%" class="reference-table">
  <col style="width:20%">
  <col style="width:80%">
<thead>
  <tr>
    <th>Category</th>
    <th>Description</th>
   </tr>
</thead>
<tbody>
  <tr>
    <td>A/B Testing</td>
    <td>Get data about each variant of an <a href='https://www.airship.com/docs/guides/experimentation/a-b-tests/messages/'>A/B Test</a>.</td>
  </tr>
  <tr><td>Attributes Current</td>
<td>Get Attribute values associated with the channels at the time the report is run.</td></tr>
  <tr>
    <td>Attributes Relative</td>
    <td>Get Attribute values associated with the channels at the time push notification or Message Center message was sent or when the in-app message was displayed.</td>
  </tr>
  <tr><td>Device Properties Current</td>
<td>Get device property values associated with the channels at the time the report is run.</td></tr>
  <tr>
    <td>Device Properties Relative</td>
    <td>Get device property values associated with the channels at the time push notification or Message Center message was sent or when the in-app message was displayed.</td>
  </tr>
  <tr><td>In-App Automation</td>
<td>Get configuration details about In-App Automations and Scenes, such as priority, dates, and display type (layout/format).</td></tr>
  <tr>
    <td>Message Content</td>
    <td>Get the message text and additional details, such as notification ID, title, etc. In the Dimension and Measure names, Journey means [Sequence](https://www.airship.com/docs/reference/glossary/#sequence).</td>
  </tr>
  <tr>
    <td>Message Delivery</td>
    <td>Get data about sends, such as dates, rates, and counts. SMS includes the Dimension <b>SMS Deliveries — Is RCS (Yes / No)</b> and the Measure <b>RCS Read Count</b>.</td>
  </tr>
  <tr>
    <td>Message Metrics</td>
    <td>Get performance data, such as response and click rates, including bounce data for email.</td>
  </tr>
  <tr><td>Query Parameters</td>
<td>Target all or specific projects, and specify dates and response windows, where relevant.</td></tr>
  <tr>
    <td>Response - Custom Events</td>
    <td>Get metrics for Custom Events associated with <a href='https://www.airship.com/docs/guides/audience/events/custom-events/#push-attribution'>App direct and indirect opens</a>.</td>
  </tr>
  <tr>
    <td>Response - Custom Event Window</td>
    <td>Get metrics for Custom Events associated with <a href='https://www.airship.com/docs/guides/audience/events/custom-events/#push-attribution'>App direct and indirect opens</a> that occurred within one hour of send time. <p>To set a new time window, go to <b>Query Parameters</b> in the sidebar, then select the <b>Response Window</b> filter and configure the filter. Fractions of an hour are accepted.</p></td>
  </tr>
  <tr>
    <td>Response - Custom Event Window - Time-only</td>
    <td>Get metrics for Custom Events, regardless of attribution, that occurred within one hour of send time. <p>To set a new time window, go to <b>Query Parameters</b> in the sidebar, then select the <b>Response Window</b> filter and configure the filter. Fractions of an hour are accepted.</p></td>
  </tr>
  <tr>
    <td>Response - Custom Interaction Events</td>
    <td>Get metrics for Custom Events associated with an <a href='https://www.airship.com/docs/developer/rest-api/ua/schemas/others/#customeventobject'><code>interaction_id</code></a>.</td>
  </tr>
  <tr>
    <td>Response - Events Times</td>
    <td>Get metrics for <a href='https://www.airship.com/docs/guides/audience/events/custom-events/#push-attribution'>App direct and indirect opens</a> that occurred within a specific number of minutes after send time. <p>To set a new time window, go to <b>Query Parameters</b> in the sidebar, then select the <b>Response Window</b> filter and configure the filter. Fractions of an hour are accepted.</p></td>
  </tr>
  <tr>
    <td>Response - Tag Changes</td>
    <td>Get Tag change events that occurred within one hour of send time. <p>To set a new time window, go to <b>Query Parameters</b> in the sidebar, then select the <b>Response Window</b> filter and configure the filter. Fractions of an hour are accepted.</p></td>
  </tr>
  <tr><td>Tags Current</td>
<td>Get Tag values associated with the channels at the time the report is run.</td></tr>
  <tr>
    <td>Tags Relative</td>
    <td>Get Tag values associated with the channels at the time push notification or Message Center message was sent or when the in-app message was displayed.</td>
  </tr>
  <tr>
    <td>Timeframe Comparison</td>
    <td>Compare data in  Measures for the most recent and prior time frames. Specify time frames in a number of days.</td>
  </tr>
  <tr><td>User Detail</td>
<td>Get information about the channel that performed the filtered event.</td></tr>
  <tr><td>User Detail - Derived</td>
<td>Get historical information about the channel that performed the filtered event.</td></tr>
</tbody>
</table>
</div>

### Default filters

<p>Use filters to reduce the number of records scanned and results returned. Each Explore includes filters that cannot be removed from the query.</p>

The filter name, [field category](#field-categories), and usage information for the default filters in the Engagement Explore:

<div class="table-scroll-wrapper">
<table width="100%" class="reference-table">
  <col style="width:20%">
  <col style="width:20%">
  <col style="width:60%">
<thead>
  <tr>
    <th>Filter name</th>
    <th>Field category</th>
    <th>Use the filter to...</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>Message Type Filter</td>
    <td>Message Delivery</td>
    <td>Return results for a specific message type. Default selection: <b>Push Notification</b>. Other possible selections: <b>Message Center</b>, <b>In-App Impression</b><sup>1</sup>, <b>Web Notification</b>, <b>SMS notification</b>, <b>Email Notification</b>, or <b>Multiple</b>.<p>By default, <b>Multiple</b> returns results for all message types, which can result in longer processing time. Add the <b>Message Type Sub Filter</b> so you can specify individual message types. After selecting <b>Multiple</b>:
      <ol>
        <li>
          In the sidebar, select <b>Message Delivery</b>.
        </li>
        <li>
          Under <b>FILTER-ONLY FIELDS</b>, select <b>Message Type Sub Filter</b>.
        </li>
        <li>In the Filters section, select the entry field next to <b>Message Type Sub Filter</b> and choose which message types to include.
        </li>
      </ol>    
    </td>
  </tr>
  <tr><td>Current Project Only</td>
<td>Query Parameters</td>
<td>
  Determine which projects are included in the query. Default selection: <b>Yes</b>. To include other projects within your company, select <b>No</b>, then:
    <ol>
      <li>
        In the sidebar, select <b>Query Parameters</b>.
      </li>
      <li>
        Under <b>Dimensions</b>, select the filter icon (
) next to <b>Project name</b>.
      </li>
      <li>In the Filters section, select the entry field next to the Project Name filter and choose which projects to include.
      </li>
    </ol>
</td></tr>
  <tr><td>Date Range</td>
<td>Query Parameters</td>
<td>Target events that occurred on a specific date or within a specific date range.</td></tr>
</tbody>
</table>
</div>

<sup>1. Includes [In-App Message (standard)](https://www.airship.com/docs/reference/glossary/#in_app_message) and [In-App Automation](https://www.airship.com/docs/reference/glossary/#iaa) only.</sup>

## Building custom queries

The following sections walk you through using the Engagement Explore to create custom queries that answer:

* How can I get the list of users who received a specific In-App Automation? Also, how can I determine whether they interacted with it?
* How can I get complete metrics for the push notifications sent within the past 30 days? 

### In-App Automation

Follow these steps to get the list of users who received a specific [In-App Automation](https://www.airship.com/docs/reference/glossary/#iaa) and determine whether they interacted with it. Users will be identified by [Channel ID](https://www.airship.com/docs/reference/glossary/#channel_id).

<!-- Not sure how to handle this yet:

> **Note:** For In-App Automations created using the [WYSIWYG editor](https://www.airship.com/docs/guides/messaging/features/wysiwyg-editor/actions/#buttons-and-images-app), the button clicks are not aggregated in the Measure **In-App Button Click Count**. Instead, build a query for the [Custom Event](https://www.airship.com/docs/reference/glossary/#custom_event) `ua_button_tap` or custom name.


-->

First, get the ID of the In-App Automation you want to build a query for. From your Airship project:

1. Go to **Messages**, then **Messages Overview**.
1. Find your In-App Automation and select the report icon (
) to open its message report.
1. In the page URL, copy the section following `push detail/`. It should look similar to: `e68039fc-7c9d-4a49-8a83-d6c8efa0cde6`.

Then [open the Engagement explore](#navigation) and configure your query:

1. Set up the filters:
   1. Set **Message Type Filter** to `is In-App Impression`.
   1. Leave **Current Audience Only** set to `is Yes`.
   1. Set **Date Range** to the period of time you want to search in.
   1. In the sidebar, select **Message Content**, then **Notification ID Filter**.
      > **Tip:** Instead of navigating to filters, Dimensions, and Measures, you can find them using the search box at the top of the sidebar.  
   1. Set **Notification ID Filter** to `is equal to` and enter the notification ID you copied from the message report URL.

1. In the sidebar, specify values to display:
   1. Select **Message Content**, then select the Dimensions **Notification ID** and **Notification Name**.
   1. Select **Message Delivery**, then select the Dimensions category **Delivery Date**, then **Date**.
   1. Select **User Detail**, then select the Dimension **Channel ID**. If you're using [Named Users](https://www.airship.com/docs/reference/glossary/#named_user) in your project, you can also add the Dimension **Named User** to identify these users in your database.

1. In the sidebar, add measurements to display:
   1. Select **Message Delivery**, then select the Measures category **All Deliveries/Impressions**, then **Total Delivery/Impression Count**.
   1. Select **Message Metrics**, then select the Measures category **In-App Impressions**, then **In-App Button Click Count** and **In-App Dismissed Count**. These distinguish which users interacted with the a button in the message content from the users who selected the Dismiss button to close the message.

<p>Now you are ready to get your data. Select <strong>Run</strong>, and you should see results similar to the below image. To save your custom query for later access, follow the steps in <a href="https://www.airship.com/docs/guides/reports/analytics/tasks-queries/saving-queries/">Saving Performance Analytics queries</a>.</p>

![Creating a custom query from the Engagement Explore](https://www.airship.com/docs/images/explore-engagement-custom-iaa_hu_965f1fab68c72541.webp)

*Creating a custom query from the Engagement Explore*

### Push notifications

Follow these steps to get the number of push notifications delivered over the past 30 days. We'll use the default filters and add a filter for platform to get only data for iOS and Android. 

First, [open the Engagement explore](#navigation), and then configure your query:

1. Set up the filters:
   1. Leave **Message Type Filter** and **Current Project Only** set to their defaults `is Push Notification` and `is Yes`.
   1. Set **Date Range** to `is in the last 30 complete days`.
   1. In the sidebar, select **User Detail**, then **Platform Filter**.
      > **Tip:** Instead of navigating to filters, Dimensions, and Measures, you can find them using the search box at the top of the sidebar.  
   1. Leave **Platform Filter** set to `is equal to`, and then select the entry field and select `ANDROID` and `IOS` from the list.

1. ![Selecting the option to pivot data](https://www.airship.com/docs/images/explore-pivot-data_hu_7acb2794baf8f83d.webp)

*Selecting the option to pivot data*

In the sidebar, specify values to display:
   1. Select **Message Delivery**, then select the Dimensions category **Delivery Date**, then **Date**.
   1. Select **User Detail**, select the Dimension **Platform**, then select the double-arrow icon next to **Platform**. The pivot option adds detailed metrics for each platform and makes it more readable. It can be helpful when using the Graph visualization.

1. In the sidebar, add measurements to display:
   1. Select **Message Delivery**, then select the Measures category **All Deliveries/Impressions**, then **Total Delivery/Impression Count**.  
   1. Select **Message Metrics**, then select the Measures category **Push Metrics**, then **Attributed Open Count**.

Now you are ready to get your data. Select **Run**, and you should see results similar to the image below.

![Creating a custom query from the Engagement Explore](https://www.airship.com/docs/images/explore-engagement-custom-push_hu_5e1d9acf4c4a9203.webp)

*Creating a custom query from the Engagement Explore*

Next, select the down arrow icon (
) next to **Visualization** and select the column icon (
). Use this format to look for obvious gaps or other changes to help you identify if something is going wrong with your push delivery:

![The column visualization of a custom query from the Engagement Explore](https://www.airship.com/docs/images/explore-engagement-custom-push-graph_hu_66714ec80cbda52a.webp)

*The column visualization of a custom query from the Engagement Explore*

To save your custom query for later access, follow the steps in [Saving Performance Analytics queries](https://www.airship.com/docs/guides/reports/analytics/tasks-queries/saving-queries/).