Send value to NR Browser as well

Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com>
This commit is contained in:
Jonathan Mezach
2023-07-12 16:29:49 +02:00
parent 9910289122
commit 8d47ae541e
@@ -111,6 +111,9 @@ export class NewRelicBrowser implements AnalyticsApi {
if (action === 'navigate' && context.extension === 'App') {
const interaction = this.agent.interaction();
interaction.setName(subject);
if (value) {
interaction.setAttribute('value', value);
}
Object.keys(context).forEach(key => {
if (context[key]) {
interaction.setAttribute(`context.${key}`, context[key]);
@@ -125,6 +128,9 @@ export class NewRelicBrowser implements AnalyticsApi {
const customAttributes: {
[x: string]: string | number | boolean | undefined;
} = {};
if (value) {
customAttributes.value = value;
}
Object.keys(context).forEach(key => {
if (context[key]) {
customAttributes[`context.${key}`] = context[key];