---
title: Magento-specific functionality
source: https://docs.newrelic.com/docs/apm/agents/php-agent/frameworks-libraries/magento-specific-functionality
---

New Relic's PHP agent includes support for automatic transaction naming for the Community and Enterprise editions of Magento 1 and 2. This document describes how this works and how you can use the automated names to track issues on your Magento application.

## Magento 1

Transactions in Magento 1 applications are named based on the module, controller, and action that handle the request. For example, a transaction for the default customer account page will be named `customer/account/index`, which indicates that the [`indexAction()` method in `Mage_Customer_AccountController`](https://github.com/OpenMage/magento-mirror/blob/1.9.3.2/app/code/core/Mage/Customer/controllers/AccountController.php#L109-L120) (the `account` controller in the `customer` module) was responsible for the transaction.

## Magento 2

Normal web transactions in Magento 2 applications are named similarly to Magento 1 transactions: the transaction name encodes the module, controller, and action that handled the request. For example, a request handled by the [`Magento\Customer\Controller\Account\Index`](https://github.com/magento/magento2/blob/2.1.4/app/code/Magento/Customer/Controller/Account/Index.php) controller class will also be named `customer/account/index`.

## Web APIs

Magento 2 also includes built-in support for [web APIs](http://devdocs.magento.com/guides/v2.1/get-started/bk-get-started-api.html). These are web services that are made available through REST and SOAP.

As of [PHP agent version 7.0](https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes/php-agent-700186), New Relic supports automatically naming transactions that use this functionality. Previous versions of the PHP agent named web API transactions as `unknown` by default.

| **Magento 2 web APIs** | **Comments**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SOAP                   | SOAP transactions are named based on the service class and method that handled the request. For example, the transaction name `Webapi/Soap/Magento\Catalog\Api\CategoryManagementInterface/getTree` indicates that a SOAP request was handled by the `getTree()` method on the model implementing `Magento\Catalog\Api\CategoryManagementInterface`. WSDL transactions are also named automatically: `Webapi/Soap/WsdlList` is used for transactions that return the list of available APIs, whereas `Webapi/Soap/Wsdl` is used for transactions that get the WSDL for a specific SOAP API.                                                                                                                                                    |
| REST                   | From Magento 2.1 onwards, REST transactions are named similarly to [SOAP](#soap) transactions. The only difference is that REST requests are prefixed with `Webapi/Rest` instead of `Webapi/Soap`. On Magento 2.0, the PHP agent is unable to automatically name the specific service class and method that handled the transaction. Instead, REST requests currently receive the generic name `FrontController/Magento\Webapi\Controller\Rest\Interceptor`. This may be improved in a future PHP agent release. As a workaround, New Relic recommends using [`newrelic_name_transaction()`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-name-wt) in the service method if greater resolution is required. |

## FrontControllerInterface plugins [#front-controller-interface-plugins]

It is possible in Magento 2 to register a [plugin or interceptor](http://devdocs.magento.com/guides/v2.1/extension-dev-guide/plugins.html) for the `Magento\Framework\App\FrontControllerInterface` interface to replace the default routing engine. For example, this is how the [web API features](#web-apis) operate.

If an interceptor is registered for `Magento\Framework\App\FrontControllerInterface`, the name of that class will be used as the default transaction name when using New Relic's PHP agent version 7.0 or higher. You can also use [`newrelic_name_transaction()`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-name-wt) for manual naming if needed.

## Escape automatic transaction naming [#problems]

If automatic transaction naming is not useful, you can override the PHP agent's automatic transaction naming by using the [`newrelic_name_transaction()`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-name-wt) API function.
