addPageAction and noticeError API in Browser metrics monitoring

Events logged through addPageAction api from browser monitoring is not visible in my Events Explorer tab but i was able to see them being sent to new relic from network tab and events logged using noticeError api is not even seen in network tab.

Actually, i’m new to this sdk Please help me, i’m not able to find is there any subsciption i’m missing to see my logged custom events as i’m able to see inbuilt events by new relic getting logged in my events explorer tab in new relic. Please let me know if anything else is required.

1 Like

@sahil.aggarwal Thanks for the question here!

Please see more information on addPageAction() API call below in the documentation. This data will be captured as PageAction event data and queried in that table via NRQL. Can you share what queries were used or where you were looking for this?

addPageAction (browser agent API) | New Relic Documentation

Here is more information on noticeError() API call and you can find this data in the JavaScriptError event type.

noticeError (browser agent API) | New Relic Documentation

There is no subscription limit for using the SPA API calls available with the browser agent. Thanks!

I was using my query like this SELECT count(*) FROM PageAction WHERE actionName=${eventName} SINCE 10 hours ago in query builder button in my application.
And in the attached SS below i was looking for my events logged from my application

I have already gone through the documentation of this apis’ and were using them after reading it.
Am i looking at wrong place, i have read this discussion Where can I view the data I passed in with `addPageAction`? for querying addPageAction data
Please can you also attach the Screenshot for noticeError api request payload as seen in devtools network tab. As i was not able to found it in network tab.

@cfrankenfield , please help here, i’m stuck due to this in my production analytics data

@sahil.aggarwal Hey there. Thank you for providing a query you were using. I looked at your application using the following query below and the last time I saw data being reported was on July 5.

SELECT * FROM PageAction WHERE appName = 'VMS' SINCE 30 days ago

Did you have any deployments on/around July 5 that may have inadvertently uninstrumented this call from your app code? Were there any other changes made around that time?

I can see that most of this data is coming from localhost / local traffic. Is there anything in your production environment (firewall, other?) that is blocking the browser ingest data from being sent on the PageAction endpoint? I’ve seen cases where local traffic works in testing and something in a production environment is blocking data.

I realize you mentioned you saw something in the network tab being logged. To confirm, the PageAction data is ingested on the /ins/* browser endpoint. Is that what you saw? Here is more information on that:

Relic Solution: Understanding, Data transmission & its Endpoints

Also, I’m not sure I understand your second question. Can you please clarify what type of screen shot or request payload you are looking for?

Thank you again,

@cfrankenfield , I haven’t deployed this on production yet.
This data is sent from console to check whether new relic was logging events. This is not the required data which i was logging from my webapp, there i have logged different events which i not able to see here. i’m logging this json object attached in below SS as second argument to addPageAction method. thus, this json object has some issues as i’m not able to find logged events from query SELECT * FROM PageAction WHERE appName = ‘VMS’ SINCE 30 days ago. Only simple events are getting logged, not nested json. Does new relic has limitation for json object which can be passed in the second argument.
Screenshot 2021-07-13 at 4.05.23 PM

The screenshot & payload i was asking for noticeError events logged as i wasn’t not able to see them in my devtools network tab.
Please let me know if other info is required

@sahil.aggarwal Thanks for the reply. To clarify, you have added the addPageAction() call to your app code locally and not seeing all of the data?

I ran the same query again and see many more entries recorded from today, July 13, mostly on http://localhost:3000/orders. Can you please confirm whether this is working now? It looks like the call is working from your code as I see many PageAction entries and attributes being recorded over the past 24 hours.

I believe I see one attribute “result” with a json object having been captured in your data as well.

There are some limits with this call as outlined in the documentation:

  • PageAction events are sent to New Relic One every 30 seconds, with a maximum of 120 events per 30-second harvest cycle, per browser.
  • After the 120-event limit is reached, additional events are not captured for that harvest cycle.

Please keep us posted and thank you!

@cfrankenfield , actually problem i was using some reserved keywords in the json attribute of addPageAction api, that’s why my events are not getting logged there.
Thnks for helping out.

@sahil.aggarwal Thanks for circling back around to let us know what was going on! And I’m happy to hear that you figured this out and resolved this issue.