Syntax
newrelic.setCurrentRouteName(string $name)
Gives SPA routes more accurate names than default names. Monitors specific routes rather than by default grouping.
Requirements
Agent version nr-998 or higher.
Description
This method names the current route. This can be useful to:
- Give routes more accurate names than they would have by default.
- Monitor a route that might otherwise be grouped with other routes by default.
Currently this method applies only to SPA BrowserInteraction
events. Using this API creates two new custom attributes that track the previous route and the target route:
previousRouteName
targetRouteName
When using this API, the browserInteractionName
attribute will take the targetRouteName
value. If setName
is used to set the browser interaction name, that will take precedence.
The setCurrentRouteName()
API determines the name attributes for BrowserInteraction
events, so this API must be called every time there is a route change. This will ensure that BrowserInteraction
events have the correct attributes.
ヒント
Compare with setName()
, which sets a name for a browser interaction, not a route.
Parameters
Parameter | Description |
---|---|
string | Required. Current route name for the page. Route names passed to If |
Examples
router.onChange(function (route) { newrelic.setCurrentRouteName(route.name)})
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicのデータセキュリティとライセンスドキュメント をご確認ください。