New Relic Events User Guide

New Relic is a software monitoring tool. The New Relic Events API is a system which allows consumers to publish custom event data to New Relic which can be charted and monitored in New Relic.

👍

Aurora has various integrations with the New Relic Events API. This document describes how to enable them and the data that is sent.

Prerequisites

  • You must have a New Relic account and it must be a US account. Aurora's integration does not support EU accounts.
  • You will need your New Relic API Key: Log in to your New Relic account and select the power button in the top right corner. Then select API Keys from the menu. Click the three dots on the row with the type of INGEST LICENSE and select Copy Key.
  • You will need your New Relic Account ID: The account ID can be found also in the API section. Look for the INGEST LICENSE item and the first column will display the Account ID. It is a number and will be in a format like 3315409

Configuration

Navigate to the the Aurora Back-end, under Store > Settings > Feeds > New Relic Events

Enter your API Key and Account ID and select the Enabled? checkbox.

Click Apply Settings to save.

New Relic Events is now enabled. However, none of the specific integrations are. It is necessary to enable each integration separately, as you see fit.

Order Reporting

When placing orders in Aurora, either via the API, backend or basket checkout, an API request will be sent to the configured New Relic Account with a summary of the order information. You can can optionally request that such notifications are delayed based on the fraud payment status.

📘

Notifications of this type must be enabled via checking the Log Ordersconfiguration option in Store > Settings > Feeds > New Relic Events

The following information will be sent to New Relic, using event type "AuroraOrder" for all orders

KeyTypeDescription
eventTypestringName of the event; ensures that notifications of this type are grouped together. This value will always be sent as "AuroraOrder".
siteDomainstringThe URL of the site where the order was placed.
orderIdstringThe unique identity of the order.
createdDatestringThe date the order was placed. Formatted as YYYY-MM-DD HH:MM:SS.
userIpstringThe IP address of the user who placed the order.
userCookiestringThe value of the ac_shop cookie at the time the order was placed.

This is a random value derived from the user's session but does not expose the session id to New Relic.
statusstringThe status of the order at the point when the order was placed.
paymentTypestringThe type of payment used on the order.
paymentSubTypestringThe sub-type of payment used on the order. This comes from the transaction additional field payment_subtype.
paymentCardTypestringThe card type of payment used on the order if applicable.
paymentTransactionIdstringThe unique identity of the order payment.
shippingCostdecimalThe total cost of the orders shipping
shippingTaxdecimalThe total cost of the orders shipping tax.
subTotaldecimalThe total cost of the order, without any added tax amounts.
taxdecimalThe total amount of tax.
totaldecimalThe total amount of the order, excluding shipping.
chargedCurrencystringThe payment currency code
couponCodestringThe coupon code, if any was used on the order.
totalDiscountdecimalThe amount of any discount applied to the order.
transactionCountintegerThe number of transactions stored against the order.
shippingTypestringThe name of the shipping type.
townstringThe name of the town of the customer; taken from the orders billing address
postcodestringThe the postcode of the customer; taken from the orders billing address.

In addition to the above order data; further custom information can be included, based on the Order Additional Fields configuration.

As additional fields are unique to a specific store and order these can vary, the below table provides a summary of the expected format.

KeyTypeDescription
additionalField.[name]stringThe additional field name and value

An example of this formatting is provided below

{
  "additionalField.Delivery_Estimate" : "3 Days",
  "additionalField.discount_card_number" : "111112222",
}

📘

Additional Field Formatting

New Relic imposes some restrictions on the formatting of the additional field values, for this reason, Aurora will format the additional field name when sent to New Relic.

Depending on the formatting of the Aurora additional field, the following formatting rules apply

  • All “additional fields” attribute names will be prefixed with additionalField. This ensures that we will never clash with any of the reserved words in NewRelic (as additional fields within Aurora do not have these same restrictions).

  • As spaces are not permitted, any additional fields which contain a space character “ “ will be replaced with an underscore “_”. An example of this might be an additional field in Aurora "Delivery Estimate" would instead be sent to NewRelic as "additionalField.Delivery_Estimate” No other modifications to the attribute would be applied (meaning that we maintain the expected character case).

Depending on the payment type and configuration within Aurora, the event notification will also include Fraud Payment information. More information regarding Fraud information can be found in the Fraud Checking Documentation

If the order contains Fraud information; the following fields will be included, for each fraud result

KeyTypeDescription
fraudCheck[num].namestringThe name of the fraud check which was performed
fraudCheck[num].actionstringThe fraud check action result (depending on the type of fraud action performed)
e.g. "HOLD", "OK" or "REJECT".
fraudCheck[num].scorestringDepending on the payment type and payment provided, this is the score associated to the fraud check action.

📘

Fraud Results

Fraud check results will vary; depending on both Aurora's and the Payment provider's configuration. Some payment providers may not provide any Fraud check information; in these cases fraud information will be omitted from the event notification.

In cases where more than one fraud result has been collected by Aurora, the above information will be repeated for each result, where the fraud check key, indicated by [num], will be increased for each fraud check result. e.g. fraudCheck1, fraudCheck2 etc.

Depending on the payment provider and Aurora configuration, fraud checks may not be immediately available at the moment that the order is placed. By default Aurora will be configured to send order information as soon as the order is placed.

If you wish to ensure that these notifications will always include any Fraud information, we can configure Aurora to delay the order notification until these checks have been completed by checking the "Only report orders after fraud checks" configuration option in Store > Settings > Feeds > New Relic Events.

📘

You can only enable "Only report orders after fraud checks" if Order Reporting is enabled.

📘

The payment fields on the Order event are taken from the first payment attached to the order. If there is more than one payment for an order please refer to the Order Payment Reporting and its event detailed below.

Order Payment Reporting

📘

When enabled, Payments will be reported to New Relic Events.

Note Only payments that have been created at the time of the Order Report will be logged.

To enable: Check Log Order Payments? and click Apply Settings to save.

📘

You can only enable Order Payment Reporting if Order Reporting is enabled.

eventTypestringThe event type for New Relic reporting. Always: AuroraOrderPayment
createdDatestringThe date the order was placed. Formatted as YYYY-MM-DD HH:MM:SS.
orderIdstringThe unique identity of the order.
transactionIdstringThe unique identity of the order payment.
paymentTypestringThe type of payment used on the order.
paymentSubTypestringThe sub-type of payment used on the order. This comes from the transaction additional field payment_subtype.
paymentCardTypestringThe card type of payment used on the order if applicable.
paymentReferencestringThe vendor reference for the payment.
paymentAmountdecimalThe amount charged for the payment.

Order Item Reporting

📘

When enabled, Order Items will be reported to New Relic Events.

To enable: Check Log Order Items? and click Apply Settings to save.

📘

You can only enable Order Item Reporting if Order Reporting is enabled.

eventTypestringThe event type for New Relic reporting. Always: AuroraOrderItem
siteDomainstringThe URL of the site where the order was placed.
orderIdstringThe unique identity of the order.
orderedItemIdstringThe unique identity of the order item.
productReferencestringThe product reference.
productNamestringThe full name of the product.
productSizestringThe size of the product sourced from variation attribute named "Size" then the products custom fields.
productQuantityintegerThe number of items of this type within the order
productUnitSoldPricedecimalThe price each product sold for.
productUnitPricedecimalThe price of each unit.
productTotalPricedecimalThe price paid.
productBuyInPricedecimalThe price of the purchased item.

In addition to these values, product fields for ordered items can be included by configuring field mappings within the Ordered Item Product Fields section e.g.

📘

A maximum of 10 product fields can be mapped to NewRelic fields that will be included within the order item reporting data.

Failed Order Reporting

📘

When enabled, if a failed order occurs in Aurora, it will be reported to New Relic Events with its related transactions and error data.

To enable: Check Failed Order Reporting enabled? and click Apply Settings to save.

Reporting frequency: Every 15 minutes, all failed orders that occurred in that period will be sent together.

The following data will be sent:

KeyTypeDescription
eventTypeStringThe event type for New Relic reporting. Always: AuroraFailedOrder
siteDomainStringThe domain the attempted order was placed on.
orderIdIntegerThe order ID. Eg: 342
userIpv4IPThe customers IP address. Eg 80.6.138.205
userCookieStringThe customers basket cookie value. Eg ac1-884f48c186531bca090902db1f3c7627076b9df4
cardNumberStringThe customers masked credit card number.
cardTypeStringThe customers credit card type.
cardExpiryStringThe customers credit card expiry date.
totalAmountIntegerThe total amount of the order. Eg 10
Transaction0DateCreatedStringThe date the transaction was created. Eg 2022-03-23 16:41:54
Transaction0TypeStringThe transaction type. Eg PayPal
Transaction0AmountFloatThe transaction amount. Eg 19.71
Transaction0ProtxTxtypeStringThe transaction TX type. Eg PAYMENT
Transaction0ProtxStatusStringThe transaction status. Eg OK
Transaction0ProtxStatusDetailStringThe transaction status detail. Eg CANCELLED OK
Transaction0ProtxVpstxidStringThe transaction Vpstxid. Eg 36001127886231111
Transaction0ProtxTxauthnoStringThe transaction Txauthno. Eg T12797

👍

Transaction data will only be provided if any transactions were created. For each further transaction in the order there will be additional set of fields, eg Transaction1DateCreated & Transaction2DateCreated.

If the order failure is related to checkout validation failures, the data will be augmented with the validation errors, each field that has an error will be included, for example:

KeyTypeDescription
invoice_address_1StringThe checkout field validation error. Eg Please supply the first line of your address.

If the order failure is in relation to a plugin failure, the data will be augmented with the following fields:

KeyTypeDescription
error_codeStringThe error code returned from the payment plugin. Eg CHECKOUT_DETAILS_INVALID
error_messageStringThe error message returned from the payment plugin. Eg Required object 'paymentMethod' is not provided.

For any other order failures, the data will be augmented with an errors key which will contain the error message.

Error Reporting

📘

When enabled, if an order occurs in Aurora, it will be reported to New Relic Events. These errors are the ones reported in Tools > Logs > Error Log.

To enable: Check Log Errors? and click Apply Settings to save.

Reporting frequency: Every 30 minutes, all errors that occurred in that period will be sent together.

The following data will be sent:

KeyTypeDescription
eventTypeStringThe event type for New Relic reporting. Always: AuroraError
siteDomainStringThe domain the error occurred on.
errorIdIntegerThe unique ID of the error. Eg 103
errorGroupStringThe error group. Eg Postcode.
errorTypeStringThe error severity. Eg emerg.
errorCodeStringThe error code. Eg -1
errorTitleStringThe short error message.
errorMessageStringThe long error message.
errorDateStringThe date the error occurred. Eg 2022-03-23 16:41:54

API Error Reporting

📘

When enabled, if an error is reported by any API which Aurora communicates with it will be reported to New Relic Events. These errors are the ones reported in Tools > Logs > API Integration Log.

To enable: Check Log API Errors? and click Apply Settings to save.

Reporting frequency: Every 15 minutes, all errors that occurred in that period will be sent together.

The following data will be sent:

KeyTypeDescription
eventTypeStringThe event type for New Relic reporting. Always: AuroraApiError
siteDomainThe domain the API error was reported to.
errorIdThe unique ID of the error. Eg 5
errorCodeThe HTTP error code from the API. Eg 404
endpointThe API endpoint. Eg https://some-api.com/api
errorRequestDataThe API request body.
errorResponseDataThe API response body.
errorDateThe date the error occurred. Eg 2022-03-23 16:41:54

Order Status SLA

Aurora provides the ability to set a Service Level Agreement (SLA) for each order status. An SLA is the maximum duration of time in which we would expect an order to stay in a status. If an order exceeds this duration of time then we would consider it “overdue” or “failing” the SLA.

New Relic integrations in Aurora now have ability to allow clients to be notified of any order which are failing the SLA.

Once you have configured New Relic, you must also enable the SLA notifications to be sent in the Aurora backend. Navigate to:

Store > Settings > Feeds > New Relic Events

Check the “Log Orders with Overdue SLA?” checkbox and ensure the first “enabled” option is also checked.

When activated, Aurora will be configured to send order notifications once per day to New Relic.

Within the New Relic system, you will need to navigate to the Events logging section to view the data. Any overdue orders will appear with the “Event Type” of AuroraOrderStatusSlaOverdue.

The following data will be sent

KeyDescription
siteDomainThe website domain name
daysInStatusThe number of days the order has been in the provided status, rounded up to the nearest whole day
daysOverdueThe number of days the order has been overdue, calculated from the number of days configured for statusSla, rounded up to the nearest whole day
orderIdThe identity of the order which is overdue
statusThe status label of the order which is overdue
statusSlaThe configured number of days set in the Order Status settings page that determines if the order is overdue
timestampThe date/time the order status overdue was recorded

Email Reporting

📘

When enabled, customer emails will be reported to New Relic Events.

To enable: Check Email reporting enabled? and click Apply Settings to save.

Reporting frequency: Every 15 minutes, all emails that occurred in that period will be sent together.

The following data will be sent:

KeyTypeDescriptionExample
EventTypeStringThe event type for New Relic reporting.Always AuroraEmailSent
TimestampStringThe date/time the event was created.2023-08-16 11:30:27
ContentStringThe URL to view the email contenthttps://www.example.org/aurora/emails/?id=5342
DateSentStringThe date/time the email was recorded as sent2023-08-16 11:28:14
DomainStringThe domain the email was sent togmail.com
EmailNameStringThe name of the email.

This will either be a value listed in Aurora Admin > Orders > Emails, or generated dynamically.

Note: The values Via API Customer Email Send or Via API Order Email Send will be used for emails sent with the API that don't use a template.
New Order GB
EmailTypeStringThe type of the email.

This will either be a value listed in Aurora Admin > Orders > Emails, or null.

Note: null values present as a blank/empty fields in New Relic.
new_order

Debugging

If you are under the impression there is a problem with your New Relic integration, you can enable logging.

Do so by checking the Log Requests? checkbox.

All subsequent requests to the New Relic Events API will be logged to the API Integration Log. To see these logs navigate to the admin area and then to:

Tools > Logs > API Integration Logs

Select your date range, then select NewRelic_API_Client from the Integration drop down and then click search.

🚧

These logs will not be sent to New Relic Events even if API Error Reporting is enabled in order to prevent an infinite loop.