New Relic Destination


New Relic enables you to better understand, using their real-time analytics, the end-to-end business impact of your software performance.

This document was last updated on August 29, 2018. If you notice any gaps, outdated information or simply want to leave some feedback to help us improve our documentation, please let us know!

Getting Started

The first step is to make sure New Relic supports the source type and connection mode you’ve chosen to implement. You can learn more about what dictates the connection modes we support here.

Web Mobile Server
📱 Device-mode
☁️ Cloud-mode
  1. From your Segment UI’s Destinations page click on “Add Destination”.
  2. Search for “New Relic” within the Destinations Catalog and confirm the Source you’d like to connect to.
  3. Drop in your Insights Account ID and your Insert Key.
  4. Once destination enabled we’ll start forwarding your calls to New Relic.

Track

If you haven’t had a chance to review our spec, please take a look to understand what the Track method does. An example call would look like:

analytics.track('Article Completed', {
  title: 'How to Create a Tracking Plan',
  course: 'Intro to Analytics',
});

We forward track calls to New Relic in order to insert custom events via their Insights API.

Your event properties will be included with the event, conforming to the following rules:

  • booleans are transformed to strings
  • reserved nrql words are wrapped with backticks
  • reserved words are removed
  • dates are converted to ISO strings
  • arrays and objects are removed

By default the events are given an eventType of ‘Segment’. This can be changed via the optional ‘Custom Default Event Type’ setting in the Segment UI.

If you pass a revenue property, we’ll pass that through as the value of the conversion.

Personas

You can send computed traits and audiences generated through Segment Personas to this destination as a user property. To learn more about Personas, reach out for a demo.

For user-property destinations, an identify call will be sent to the destination for each user being added and removed. The property name will be the snake_cased version of the audience name you provide with a true/false value. For example, when a user first completes an order in the last 30 days, we will send an identify call with the property order_completed_last_30days: true, and when this user no longer satisfies we will set that value to false.

When the audience is first created an identify call is sent for every user in the audience. Subsequent syncs will only send updates for those users which were added or removed since the last sync.

Settings

Segment lets you change these destination settings from your Segment dashboard without having to touch any code.

Account ID

Your New Relic Insights account ID

Custom Default Event Type

By default the eventType for any unmapped track events will be sent as ‘Segment’. You can define another custom eventType name to be used instead of that here.

Map Track Events to Custom Tables

Enter your Segment .track() event names on the left and their respective eventType (table name) in New Relic.

Insert Key

Put your New Relic Insert Key

Send Device Context

If you enable this setting, we will flatten all your context fields delimited by a period and send it to New Relic. This is recommended as getting rich device context is useful inside New Relic.

Send UserId and AnonymousId

If you want to send your Segment userId and anonymousId, enabling this option will do so.

Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account