How to Use Magento 2 New Relic APM to Speed Up Checkout?

How to Use Magento 2 New Relic APM to Speed Up Checkout?

Are slow checkout pages costing you sales every day? Magento 2 New Relic APM identifies performance issues that slow down checkout completion. It also helps in implementing solutions and preventing bottlenecks before they impact customers.

This article explains how to optimize checkout pages using New Relic APM. It covers transaction monitoring, database fixes, and custom metrics setup.

Key Takeaways

  • 5 New Relic APM integration strategies optimize checkout page speeds.

  • Transaction traces show the exact locations of checkout performance problems.

  • Database query fixes the speed of checkout response times.

  • Apdex thresholds measure customer happiness with checkout speed.

  • Custom error tracking prevents checkout abandonment through early monitoring.

What is Magento 2 New Relic APM?

Magento 2 New Relic APM definition

Magento’s New Relic APM captures performance data during checkout operations. The platform records the following metrics across your checkout flow across 3 critical areas:

  • Transaction Monitoring: Records execution time for each checkout step, including:

    • Cart operations

    • Shipping calculations

    • Payment processing

  • Database Monitoring: Captures SQL query performance during checkout operations, like:

    • Inventory checks
    • Price calculations
  • Error Tracking: Documents checkout failures, including:

    • Payment gateway timeouts
    • Validation errors

The platform works with Magento 2 through PHP agent installation. Its basic monitoring functionality does not need any checkout code changes.

It speeds up checkout by pinpointing performance bottlenecks. The tool helps you make the right fixes using current data.

Why Speed Up Checkout in Magento 2?

Checkout speed changes increase revenue and customer satisfaction for Magento 2 stores.

  • Checkout performance affects conversion rates more than any other site speed factor.

  • Slow checkout processes increase cart abandonment rates. Mobile users tend to abandon checkout more quickly than desktop users.

Magento 2 checkout processes involve complex operations:

  • Product Inventory Validation: Across several warehouse locations.

  • Real-Time Shipping Rate Calculations: From many carriers.

  • Tax Calculations: Based on customer location and product categories.

  • Payment Gateway Authorization: For fraud detection processing.

These operations create performance problems without proper monitoring. Magento 2 New Relic integration reveals the specific operation that slows down checkout. Thus, you can fix the right problem first.

4 Common Causes of Slow Checkout in Magento 2

Knowing checkout performance issues helps you focus your efforts well.

1. Database Query Problems

Poor database queries cause most checkout delays. It is because Magento 2 is not optimized for your specific store setup.

  • What Happens: Cart total calculations scan the entire product catalog. They do not target specific items

  • Why This Occurs: Missing database indexes cause the system to search each record.

  • The Result: Full table scans during price calculations that take several seconds

2. Third-Party Integration Delays

Third-Party Integration Delays

External services introduce unpredictable delays. It is because your checkout depends on systems outside your control.

  • What Happens: Payment gateways experience timeouts during peak traffic periods

  • Why This Occurs: External APIs have their own performance limits and maintenance windows

  • The Result: Customers wait while shipping calculators struggle with carrier API limits

3. Frontend Resource Problems

Heavy JavaScript libraries delay checkout page rendering. This is because browsers must download and process large files before showing content.

  • What Happens: Many CSS files and large images consume too much bandwidth

  • Why This Occurs: Each resource requires a separate HTTP request. This creates a loading bottleneck

  • The Result: Customers see blank pages while scripts load, especially on mobile connections

4. Server Resource Limits

Poor server resources create performance problems. This is because checkout operations need significant computing power.

  • What Happens: CPU limits affect checkout calculation speed during high-traffic periods

  • Why This Occurs: Many customers check out at the same time. This overwhelms the available processing power

  • The Result: Memory limits trigger garbage collection that interrupts transactions

How to Speed Up Checkout Using Magento's New Relic APM?

1. Track Checkout Transactions

Track Checkout Transactions

Transaction monitoring shows performance patterns across your entire checkout funnel.

I. Know Transaction Traces

Transaction traces record complete execution paths for individual checkout requests. Each trace captures timing data for:

  • Database queries

  • External API calls

  • PHP function execution

Access transaction traces through your New Relic dashboard:

  • Navigate to the APM Section: Select your Magento application.

  • Click Transaction Traces: View detailed execution data.

  • Filter Traces by Checkout URLs: Carry out targeted analysis.

Track key Checkout URLs:

  • Cart Item Additions: /checkout/cart/add for cart item additions.

  • Shipping Selections: /checkout/onepage/saveShippingMethod for shipping selections.

  • Order Completion: /checkout/onepage/saveOrder for order completion.

II. Find Slow Transactions

Transaction analysis highlights poor-performing checkout over time. Sort transactions by average response time to identify targets.

Core performance information includes:

  • Average Response Time: Typical execution duration for checkout operations.

  • 95th Percentile Time: Worst-case performance affecting frustrated customers.

  • Throughput: Number of checkout operations completed per minute.

  • Error Rate: Percentage of failed checkout attempts.

Recommendation: Focus on transactions with response times exceeding 2 seconds. These delays create noticeable friction for customers during checkout.

III. Study the Call Stack

Call stack analysis finds the exact functions causing checkout delays. New Relic displays execution timing as waterfall charts showing component performance.

Examine these recommended problem indicators:

  • Database Query Segments: Longer than 100 milliseconds.

  • External API Calls: Exceeding 1-second response times.

  • PHP Function Execution: Consuming over 500 milliseconds.

  • Memory Allocation Operations: Taking too much time.

Document specific function names and execution times for targeted efforts.

2. Study Database Queries

Database changes provide the highest impact gains for checkout performance.

I. Locate Slow Database Queries

Database monitoring identifies SQL queries that cause delays in checkout operations. Access database analysis through the "Databases" tab in New Relic.

Sort queries by these performance indicators:

  • Total Time: Combined execution time across all query instances.

  • Average Duration: Typical execution time per query.

  • Call Count: Frequency of query execution during checkout.

Target checkout-related database tables:

  • Quote Table: For shopping cart data storage.

  • Quote Item Table: For individual cart item details.

  • Catalog Product Entity Table: For product information retrieval.

  • Sales Order Table: For completed order records.

II. Speed Up Queries

Every checkout action triggers database queries. This makes them a primary target for optimization. Proper analysis ensures actual bottleneck fixes instead of guesswork.

Query changes demand careful analysis of execution plans and index usage. Common strategies provide immediate performance gains.

A. Index Creation for Often Accessed Data:

CREATE INDEX idx_quote_customer_id ON quote(customer_id);
CREATE INDEX idx_quote_item_quote_id ON quote_item(quote_id);
CREATE INDEX idx_catalog_product_entity_sku ON catalog_product_entity(sku);

B. Query Rewriting for Performance:

Replace slow subqueries with JOIN operations. Limit result sets using appropriate WHERE clauses. Avoid SELECT * statements that retrieve unnecessary columns.

C. Result Set Caching Setup:

get($cacheKey);
if (!$shippingRates) {
    $shippingRates = $this->calculateShippingRates($cart);
    $cache->set($cacheKey, $shippingRates, 300); // 5-minute cache
}
?>

III. Track Performance Over Time

Query performance changes as your store grows and traffic patterns shift. This makes ongoing monitoring essential to catch problems early. Without baseline data, you cannot tell if the current performance is normal or declining.

So, create custom dashboards. Track query execution times across different traffic patterns.

Configure Performance Alerts:

  • Set Thresholds: At 150% of baseline query performance.

  • Check Query Execution Frequency: During peak hours.

  • Track Cache Hit Rates: For changed queries.

  • Alert on Database Connection Pool Exhaustion: When the system reaches its limits.

3. Fix Checkout Errors

Fix Checkout Errors

Error fixes prevent customer frustration and increase checkout completion rates. It identifies where customers encounter problems during checkout.

This allows you to drop specific failure points. By addressing these issues, you end the friction, causing buyers to abandon purchases.

I. Set Up Error Tracking

Better error tracking captures contextual information that standard logging misses. Configure New Relic to record checkout-specific error details.

paymentProcessor->processPayment($paymentData);
} catch (PaymentException $e) {
    newrelic_record_exception($e);
    newrelic_add_custom_parameter('checkout_step', 'payment_processing');
    newrelic_add_custom_parameter('payment_method', $paymentData['method']);
    newrelic_add_custom_parameter('cart_value', $cart->getGrandTotal());
    newrelic_add_custom_parameter('customer_type', $customer->getGroupId());
    
    $this->logger->error('Payment processing failed', [
        'exception' => $e->getMessage(),
        'customer_id' => $customer->getId(),
        'quote_id' => $cart->getId()
    ]);
    throw $e;
}
?>

II. Study Error Logs

Error pattern analysis shows issues affecting checkout success rates. Group errors by type, frequency, and customer impact.

The checkout error categories are:

  • Payment Gateway Timeouts: Occur during high traffic or gateway maintenance periods.

  • Address Validation Failures: Result from international address format problems.

  • Inventory Sync Errors: Occur when inventory updates fail to keep pace with sales.

  • Session Expiry Issues: Affect customers with extended browsing sessions.

Track error correlation with:

  • Time of Day: For traffic volume.

  • Customer Geographic Location: For regional patterns.

  • Device Type: For browser version.

  • Payment Method Selection: For gateway-specific issues.

III. Apply Required Fixes

Error data guides changes that prevent checkout abandonment. Focus on fixes based on error frequency and revenue impact.

A. Payment Gateway Retry Logic:

paymentGateway->process($paymentData);
            } catch (TimeoutException $e) {
                if ($attempt === $maxRetries) {
                    throw $e;
                }
                $waitTime = pow(2, $attempt); // Exponential backoff
                sleep($waitTime);
                newrelic_add_custom_parameter('payment_retry_attempt', $attempt);
            }
        }
    }
}
?>

4. Measure Apdex Score Happiness

Apdex scoring translates technical performance into customer satisfaction information.

I. Know Apdex Scores

Apdex scores measure user happiness based on response time thresholds. The metric ranges from 0 to 1. Higher scores mean a better customer experience.

Apdex calculation uses 3 performance zones:

  • Happy Zone: Response times that feel instant to customers.

  • Tolerating Zone: Noticeable delays that do not cause abandonment.

  • Frustrated Zone: Unacceptable delays that trigger cart abandonment.

Different checkout operations in Magento 2 demand different thresholds. Base the limits on customer expectations and technical complexity.

II. Set Apdex Thresholds

Define Apdex thresholds based on checkout step complexity and user behavior research.

Recommended Apdex Thresholds:

Checkout Operation Happy (Seconds) Frustrated (Seconds)
Cart Item Addition < 1.0 > 3.0
Shipping Calculation < 2.0 > 5.0
Tax Calculation < 1.5 > 4.0
Payment Processing < 3.0 > 8.0
Order Confirmation < 2.0 > 6.0

Configure different thresholds for mobile and desktop users. Mobile customers expect faster response times than desktop users.

III. Focus on Performance Changes

Apdex trends identify which checkout steps need immediate attention. Focus on operations with low scores or declining trends.

Setup Strategy:

  • Track Apdex Scores: During different traffic periods.

  • Set Alerts: When scores drop below 0.85 for critical checkout steps.

  • Connect Apdex Changes: With deployment and configuration changes.

  • Track Apdex Gains: Following changes.

5. Set Up Custom Tracking

Set Up Custom Tracking

Custom tracking captures business-specific performance indicators. Standard APM tracking does not cover these metrics.

I. Define Checkout-relevant Tracking

Custom tracking connects technical performance to business results. Design tracking that aligns with checkout goals and revenue objectives.

Checkout Performance Tracking Metrics:

  • Checkout Funnel Velocity: Time from cart view to order completion.

  • Step-Wise Abandonment Rates: Customer exit points within checkout flow.

  • Payment Method Performance: Completion rates by payment type.

  • Geographic Performance Variance: Checkout speed by customer location.

  • Device-Specific Conversion Data: Mobile versus desktop performance.

II. Add Checkout-specific KPIs

New Relic's custom API allows tracking of checkout-specific business data. This happens alongside technical performance information.

stepStartTimes[$stepName] = microtime(true);
        newrelic_add_custom_parameter('checkout_step_start', $stepName);
    }
    
    public function completeStep($stepName) {
        if (isset($this->stepStartTimes[$stepName])) {
            $duration = (microtime(true) - $this->stepStartTimes[$stepName]) * 1000;
            newrelic_record_metric("Custom/Checkout/Step/{$stepName}/Duration", $duration);
            newrelic_add_custom_parameter("checkout_step_duration_{$stepName}", $duration);
            unset($this->stepStartTimes[$stepName]);
        }
    }
    
    public function recordAbandonmentPoint($stepName, $reason) {
        newrelic_record_metric("Custom/Checkout/Abandonment/{$stepName}", 1);
        newrelic_add_custom_parameter('abandonment_reason', $reason);
    }
}
?>

III. Create Custom Dashboards

Design dashboards that present checkout data in useful formats for different people.

A. Dashboard Components for Technical Teams:

  • Live Checkout Step Performance Trends: With 95th percentile data.

  • Database Query Performance: Connects with checkout step timing.

  • Error Rates by Checkout Step: With fixed time tracking.

  • Server Resource Use: During peak checkout periods.

B. Dashboard Components for Business Teams:

  • Checkout Conversion Rates: By traffic source and device type.

  • Revenue Impact: Of performance changes over time.

  • Customer Happiness Scores: Connects with checkout speed.

  • Competitive Performance Benchmarking: Against industry standards.

FAQs

1. How long does New Relic store my Magento checkout performance data?

Data retention varies by subscription plan. Free accounts have limited retention, while paid plans offer extended storage periods. Enterprise accounts provide the longest data retention for complete trend analysis.

2. Can the New Relic APM connect with Magento 2 Google Analytics?

Yes. You can connect both using custom dashboards. Link checkout performance data with conversion tracking data. Use Magento’s webhook connections to sync performance alerts with Analytics events.

3. Does New Relic APM slow down my Magento 2 checkout process?

New Relic adds almost-zero overhead to page response times. The monitoring impact is small compared to the gains in performance information. Most stores see net performance gains after applying APM-guided changes.

4. What differs between New Relic APM and Google PageSpeed?

New Relic tracks server-side performance without stopping. PageSpeed focuses on frontend changes. APM tracks database queries and checkout transactions. PageSpeed analyzes page loading speed and user experience data.

5. How do I troubleshoot New Relic APM connection issues with Magento?

Check the PHP agent installation status in the phpinfo output. Verify license key configuration in the newrelic.ini file. Restart the web server after configuration changes. Contact New Relic support if the data does not appear within 10 minutes.

Summary

Magento 2 New Relic APM shifts checkout speed monitoring to proactive control. The platform shows transaction flows, database performance, and customer happiness data. This produces measurable gains in checkout conversion rates:

  • Transaction monitoring identifies specific problems in checkout flows.

  • Database changes speed up query execution times.

  • Error tracking prevents customer frustration through early issue fixing.

  • Apdex scoring measures customer happiness with checkout performance gains.

  • Custom tracking connects technical changes to revenue growth.

Ready to speed up your checkout process? Managed Magento hosting provides specific server foundations for optimal performance monitoring.

Anisha Dutta
Anisha Dutta
Technical Writer

Anisha is a skilled technical writer focused on creating SEO-optimized, developer-friendly content for Magento. She translates complex eCommerce and hosting concepts into clear, actionable insights. At MGT Commerce, she crafts high-impact blogs, articles, and performance-focused guides.


Get the fastest Magento Hosting! Get Started