Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Relic Solution: Custom attributes vs Custom events

mobile

#1

Custom attributes vs. Custom events

The New Relic Mobile agents collect a wide variety of information from your app in the form of Event data which can be found in Insights. Along with this default information, the agents’ API allows you to add some preset attributes like userId as well as custom events and attributes.

What information is recorded in Insights by default?

The Mobile agents send some default event data from your mobile app to Insights, such as data about interactions, sessions, crashes, and request errors. For a list of these event types and attributes please check out the Mobile events and attributes doc.

When should we use custom attribute or custom event?

Custom attribute

Custom attribute is added as a session attribute. The session attributes copy to all events (including default and custom events) which are created during the session. If you want to record any information during a session to all events, you can use custom attributes.

These custom attributes should be something that doesn’t change through the session such as if a user authenticated through saml, free account vs paid account, or if items were left in a cart from the last session.

Custom event

For custom event, the agent will create a new event type. This is helpful if you are trying to record an action or a feature of the app that includes a few attributes that don’t relate to any default events. For example, a purchase action may include product id, product name, price and etc.

How to record custom attributes or events?

Where to find custom attributes or events?

After generating some traffic with the app, you can go to Insights and then run a query using NRQL to view the data in the way you want.

Feel free to share your use cases or questions about this by replying this post. :slight_smile:


Any APIs that we can use to separate two SESSIONS?
Best Practices Guide: Mobile