PageAction, custom events and BrowserInteraction are three different ways the browser agent records "something happened." Read the docs
Checking for browser agent…
New Relic browser events

Something
happened.

Three ways to tell New Relic. One you call explicitly and it always lands as PageAction. One you call explicitly and you pick the name. One fires on its own, but not for the reason most people assume.

Common assumption: BrowserInteraction records every interaction. Despite its name, it doesn't. It is only saved when a click is followed by a URL (route) change, then a DOM update after that change. The buttons below prove it both ways.
// PageAction: always this event type, call it any time
newrelic.addPageAction('Signed up', { plan: 'pro' })
// -> PageAction, agent v593+

// Custom event: you choose the event type
newrelic.recordCustomEvent('DemoAction', { plan: 'pro' })
// -> DemoAction, agent v1.277.0+

// BrowserInteraction: automatic, but only for this
history.pushState({}, '', '#route') // 1. URL changes
el.textContent = 'done' // 2. then DOM changes
// -> BrowserInteraction, category: Route change
Your data is tagged as … NR-XXXX Change

Everyone shares one New Relic account, so your clicks are tagged as demoUser and demoCode custom attributes (your name is also set as your end-user ID via setUserId()), carried onto every PageAction, DemoAction and BrowserInteraction event you generate below.

Write this code down. You will search for NR-XXXX in the queries further down. It stays the same on every page until you click New code or close this tab.

Try it / Trigger one

Pick your event

Four buttons, four outcomes. The agent decides what actually gets saved, and this page has no way to read that verdict back. The activity feed on the right only shows what you did locally. Give it a minute or two, then check the queries below for what New Relic actually recorded.

How each one fires

Explicit, explicit, automatic-but-not-how-you'd-guess

addPageAction(name, attrs): fully manual, works for anything. Always lands as the fixed event type PageAction. Needs agent v593+ (effectively always available). Free attributes you didn't ask for: actionName, timeSinceLoad, referrerUrl, browserWidth, browserHeight. Has its own on/off switch, init.page_action.enabled (on by default).

recordCustomEvent(eventType, attrs): also fully manual, but you name the event type instead of always getting PageAction. Needs agent v1.277.0+, genuinely newer. No bonus attributes, just what you send. Not gated by page_action.enabled. New Relic's own guidance: keep it to roughly 5 event types per account, not one per action.

BrowserInteraction: the only one of the three that fires on its own. Despite its name, it doesn't record every interaction. The agent requires a click, then a URL (route) change, then a DOM update after that change, in that order. A click that changes no route never becomes its own BrowserInteraction, no matter how many times you click. The two buttons below prove both halves of that.

1 · PageAction

addPageAction()

Purely client-side. No request, no route change: just a button that matters to you.

Nothing sent yet.

2 · Custom event

recordCustomEvent()

Same idea, but under an event type you chose: DemoAction, not PageAction.

Nothing sent yet.

3 · BrowserInteraction, half the recipe

AJAX only, no route change

Fetches data/products.json and shows the result. No matter how many times you click this, it will not become its own BrowserInteraction. Watch the queries below.

Nothing sent yet.

4 · BrowserInteraction, the full recipe

Route change, then update

Changes the URL fragment first, then updates this card. URL change before DOM change is what the agent is actually watching for.

Nothing sent yet.

Find it / Search the shared account

Find your events

Allow a minute or two for events to arrive. Everything below is already filled in with your code, NR-XXXX.

All three side by side

  1. Open the query builder in New Relic and run this. If a route didn't change, no BrowserInteraction row shows up here at all. That's expected, not a bug.

          
Open New Relic

Just your PageAction events

actionName, timeSinceLoad and referrerUrl came free; you never set them.


          

Just your custom events

Same shape as PageAction, but under the DemoAction event type you chose, with no bonus attributes.


          

Just your BrowserInteraction events

Only the "route change, then update" button produces one of these. The "AJAX only" button never does.


          

See it in the UI

  1. Go to Browser, open the demo app, then Browser interactions or Page views to see BrowserInteraction rows for real route changes across the whole app.
  2. There's no dedicated UI page for PageAction or custom events. The query builder and dashboards are how you see them.
  3. Filter any of the above by demoCode = NR-XXXX to see only your events.
Not seeing a BrowserInteraction from the AJAX-only button?That's correct, not broken. It needs a route change first. The AJAX-only button deliberately never gives it one.
Not seeing anything at all?Make sure the agent badge up top says "detected." Then give it a minute or two. Events harvest roughly every 30 seconds.