---
title: Analyze E-Commerce Operations Using Payment and Customer Feedback Data
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Log Management > Logs Guides > Analyze E-Commerce Operations Using
  Payment and Customer Feedback Data
---

# Analyze E-Commerce Operations Using Payment and Customer Feedback Data

## Overview{% #overview %}

Notebooks Analysis features enables e-commerce businesses to gain valuable insights into their online stores by analyzing transaction data, customer behavior, and system performance. This guide shows how to use Notebooks Analysis features to monitor your e-commerce platform, detect issues, and optimize the shopping experience.

## Benefits{% #benefits %}

Using Notebooks Analysis features for e-commerce monitoring offers several advantages:

- **Real-time transaction visibility**: Track sales, cart abandonment, and checkout processes as they happen
- **Customer experience insights**: Identify pain points in the customer journey
- **Revenue impact analysis**: Quantify the financial impact of technical issues
- **Performance optimization**: Pinpoint and address bottlenecks affecting conversion rates

This guide demonstrates how to use Notebooks Analysis features with an example focusing on payment failures and customer ratings.

## Understanding the data{% #understanding-the-data %}

Follow this example to understand how to correlate **payment processing errors** from your `web-store` service with **negative customer ratings and reviews** from the `shopist-customer-feedback` service. It also demonstrates how to quantify the **revenue impact** of bad ratings caused by failed payment experiences.

The example focuses on two critical aspects of e-commerce operations:

- **Payment Processing**: Logs from the payment gateway indicating successful and failed transactions
- **Customer Feedback**: Ratings and reviews submitted after purchase attempts

## Bringing in your data source and building your queries{% #bringing-in-your-data-source-and-building-your-queries %}

Create a notebook and add data sources for payment transactions and customer feedback. For more information, see [Notebooks Analysis features](https://docs.datadoghq.com/notebooks/advanced_analysis/).

### 1. Customer feedback with bad ratings

This data source cell contains customer feedback logs with negative ratings collected by the ratings service, focusing on customers who reported issues.

{% image
   source="https://datadog-docs.imgix.net/images/logs/guide/log_analysis_use_cases/analyze_ecommerce_ops/customer_feedback_bad_ratings.09fcf01724890e0746776849870b08b0.png?auto=format"
   alt="Data source configuration for customer feedback logs showing negative ratings filter" /%}
Data source cell for customer feedback, filtering to show only negative ratings to identify problematic experiences.
### 2. Webstore payment errors

This data source cell shows payment error logs from the e-commerce platform, including the merchant ID and cart value to help identify high-impact failures.

{% image
   source="https://datadog-docs.imgix.net/images/logs/guide/log_analysis_use_cases/analyze_ecommerce_ops/webstore_payment_errs.9066c070c6c9c2c580e9ff2c0b50bb4c.png?auto=format"
   alt="Data source configuration for payment error logs with cart value and merchant information" /%}
Data source cell for payment errors, showing transaction details including cart value and merchant information.
## SQL query analysis{% #sql-query-analysis %}

### Query purpose and structure{% #query-purpose-and-structure %}

This query correlates payment errors with customer feedback, categorizing transactions by value to understand the relationship between technical issues, customer satisfaction, and revenue impact.

In the `Complete SQL query` file:

```sql
SELECT
    wpe.timestamp,
    wpe.Merchant,
    wpe.cart_value,
    wpe.display_id,
    CASE
        WHEN wpe.cart_value > 50 THEN 'high value'
        ELSE 'low value'
    END AS tier
FROM
    webstore_payment_errs wpe
JOIN
    customer_feedback_bad_ratings cfbr ON wpe.display_id = cfbr.display_id
WHERE
    cfbr.status = 'info'
ORDER BY
    cart_value DESC
```

{% collapsible-section %}
#### Query breakdown

This SQL query performs several important functions:

1. **Data correlation**: Joins payment error logs with customer feedback logs using the `display_id` to connect the same transaction
1. **Value segmentation**: Categorizes transactions as "high value" (>$50) or "low value" to prioritize issues
1. **Merchant identification**: Includes the merchant information to identify patterns by seller
1. **Chronological tracking**: Timestamps help identify when issues occurred
1. **Prioritization**: Orders results by cart value to highlight highest revenue impact first

The query focuses on payment errors that also received bad ratings, providing a view of technical issues that directly affected customer satisfaction.
{% /collapsible-section %}

### Query output{% #query-output %}

The query from the Analysis cell populates a table showing payment errors that resulted in negative customer feedback, categorized by value tier. By analyzing this data, you can prioritize fixes based on revenue impact and improve both technical reliability and customer satisfaction.

{% image
   source="https://datadog-docs.imgix.net/images/logs/guide/log_analysis_use_cases/analyze_ecommerce_ops/analysis_join_bad_ratings_with_payment_errors.7a82340273a5f8fe90123ea5ee04d286.png?auto=format"
   alt="SQL query results showing payment errors with associated customer feedback, merchant information, and value categorization" /%}
Analysis results showing correlated payment errors and customer feedback, with transactions categorized by value tier for prioritization.
## Visualize the data{% #visualize-the-data %}

Notebooks Analysis features provides powerful visualization capabilities to transform your e-commerce data into actionable insights:

- **Time series charts**: Track payment errors and bad ratings over time to identify patterns or spikes
- **Merchant performance comparisons**: Compare success rates across different sellers on your platform
- **Value tier distribution**: Visualize the proportion of issues affecting high vs. low value transactions
- **Geo-distribution maps**: See where payment issues are occurring geographically

{% image
   source="https://datadog-docs.imgix.net/images/logs/guide/log_analysis_use_cases/analyze_ecommerce_ops/visualization_most_bad_ratings.0490480c437dc8540223e4b92b0f6edb.png?auto=format"
   alt="Visualization of e-commerce data showing payment errors by merchant and value tier" /%}
Treemap graph showing the distribution of payment errors by merchant and value tier, highlighting which sellers have the most high-value transaction issues.
## Advanced analysis on SQL queries{% #advanced-analysis-on-sql-queries %}

Reference tables in Notebooks Analysis features allow you to import additional contextual data to enrich your analysis. For e-commerce operations, reference tables can provide critical business context that isn't available in your logs alone.

In this example, we'll use a reference table containing merchant details to enhance our payment error analysis:

### 1. Create a reference table

Upload a CSV file with merchant information or query it from another data source.

{% image
   source="https://datadog-docs.imgix.net/images/logs/guide/log_analysis_use_cases/analyze_ecommerce_ops/merch_details.de5609bf56bba755fb8d6187e8f6dbd0.png?auto=format"
   alt="Reference table showing merchant details including merchant ID, name, contact information, and tier status for e-commerce analysis" /%}



### 2. Join with log data

Use the merchant ID as the common key to connect log data with merchant details. In the example, analysis combines payment error logs with merchant reference data to provide business context for troubleshooting.

{% image
   source="https://datadog-docs.imgix.net/images/logs/guide/log_analysis_use_cases/analyze_ecommerce_ops/combined_salesforce.26f53c920a66e48f3e896332ce9a5153.png?auto=format"
   alt="SQL query joining log data with merchant reference table to provide business context for payment errors" /%}



### 3. Calculated field queries

Add business context like merchant tier, contract details, or support contacts. The following [Calculated Field](https://docs.datadoghq.com/notebooks/advanced_analysis/#calculated-fields-queries) query computes the sum of lost revenue from failed transactions, grouped by merchant tier to identify high-impact segments:

{% image
   source="https://datadog-docs.imgix.net/images/logs/guide/log_analysis_use_cases/analyze_ecommerce_ops/sum_lost_revenue.bfb87b8b06bc72fa7cf44a6c804ad1f9.png?auto=format"
   alt="SQL query calculating total lost revenue from failed transactions by merchant tier" /%}



### 4. Visualize the results

Create charts to visualize the lost revenue by merchant tier for clearer business impact assessment. The following pie chart displays the distribution of lost revenue across different merchant tiers, highlighting which segments contribute most to revenue loss and require immediate attention. This graph makes it easier for stakeholders to quickly identify which merchant categories are experiencing the highest financial impact from failed transactions.

{% image
   source="https://datadog-docs.imgix.net/images/logs/guide/log_analysis_use_cases/analyze_ecommerce_ops/visualize_total_loss_revenue.1cb575d6eed083165740a0b48ec4d879.png?auto=format"
   alt="Visualization of total lost revenue from failed transactions by merchant tier" /%}



## Further reading{% #further-reading %}

- [Learn more about Notebooks Analysis features](https://docs.datadoghq.com/notebooks/advanced_analysis/)
