• /
  • EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

Report browser monitoring custom events and attributes

You can use browser monitoring in New Relic to add custom events and attributes.

Page actions and views

Use the browser API's addPageAction call to capture events, actions, route changes, or any end-user interactions with your application. The addPageAction call adds an event named PageAction that contains the action name and any custom attribute names and values you capture along with it. The PageAction event also contains any custom attributes you added to the PageView event.

Add custom attributes to the PageView event so you can query or filter your data to answer more questions about your application.

Prerequisites

In order to report PageAction events, verify these prerequisites:

Requirement

Comments

Agent version

Your browser monitoring agent version must be 593 or higher.

Client browser version

To record PageAction events, the browser must support cross-domain XHRs.

Events per cycle

PageAction events are sent every 30 seconds. If 1,000 events are observed, the agent will harvest the buffered events immediately, bypassing the harvest cycle interval.

Event/attribute naming, data type, size

Ensure you follow general requirements around event/attribute naming syntax, data types, and size.

Create PageAction events

To create a PageAction event:

  1. Ensure the browser agent is installed for your app.
  2. Call the newrelic.addPageAction function in the relevant part of your application's JavaScript.
  3. Wait a couple minutes for the application to run and report relevant PageAction events.
  4. Run a NRQL query of the PageAction event that includes the actionName attribute you used to capture the event (and any associated attributes you sent along with the action).

Add custom attributes to PageView event

The PageView event is a default browser-reported event. You can add custom attributes to the PageView event. Any custom attributes you add to the PageView event are also automatically added to the PageAction event.

There are two ways to add custom attributes to the PageView event:

PageAction and PageView attributes

To see the default attributes of PageAction and PageView, see Browser events.

Troubleshooting

Here are some troubleshooting tips:

Problem

Comments

Custom attributes missing

If your custom attributes do not appear on PageView events, verify you are calling setCustomAttribute before the Load event on your page. If the custom attribute is called after the page load occurs, it will not be visible on PageView.

PageAction events

If your PageAction events do not appear when you query, review the requirements.

If the requirements are met, check that you're not using reserved attribute names or invalid values.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.