Counting unique sessions today, yesterday, this month - odd results?

Hello - I am still finding my feet with NRQL and understanding which dashboard technology I am supposed to use in NewRelic (I still find it very confusing, what is old, what is new?)

So I think NewRelicOne is what I’m supposed to use these days right?

So I have taken a query suggested to me in the browser section, to give me a quick idea on the number of users hitting our site (we haven’t got Google Analytics embedded in our app, and I am hoping NewRelic can get me most of the info I need - its supposed to do this right?)

So I thought that the following would do this:
SELECT uniqueCount(session) FROM PageView SINCE TODAY

And variants of it would show me yesterday, this week, this month? e.g.
SELECT uniqueCount(session) FROM PageView SINCE YESTERDAY
SELECT uniqueCount(session) FROM PageView SINCE THIS WEEK
SELECT uniqueCount(session) FROM PageView SINCE MONTH

I get numbers for the above that are similar to this: 605, 850, 660, 660 ?

So I don’t understand this - yesterday was busier (but today isn’t quite complete), but why would this week only be marginally bigger than today (and less than yesterday?), and why would this month be the same as this week? This makes no sense to me?

Am I misunderstanding what these kinds of queries should do? Or have I got some data setting wrong?

I’m getting more and more confused trying to understand the data the NR is supposed to get to me.

Thanks for the help,


Hi, @tim.mackinnon1: It looks like you do not have a paid subscription to New Relic Browser, so you have only one day of event data available. You can confirm this by executing the following query:

SELECT count(*) FROM PageView SINCE 1 week ago FACET weekdayOf(timestamp)
1 Like

Hi @philweber, thanks for chipping in - I have run your query and it seems to give sensible results for the whole week, with thousands of views m/t/w/th/f, and hundreds on the weekend. So I would infer that the data is there.

We have a yearly multiserver APM subscription and Browser Lite ? Not sure what all this means though. But do pageviews and session counts come from APM (they are a backend thing aren’t they?).

I’ve now noticed that our daily session count queries are not giving true numbers either - it is undercounting by about 50%-75%.

We must have something wrong on our setup - or I am not understanding how it works properly - as this is the 2nd issue I’ve found now that makes me questions the validity of the data.

How can I get help to validate this?


No, PageViews and session IDs come from New Relic Browser. I cannot explain why you see PageView events for more than one day. I think a support ticket is the best way to figure out what is happening with your account.

How do you raise a support ticket - the world of NewRelic is one of the most confusing I’ve encountered in a long time… so many legacy products and options and pricings… its diabolical.

When I try and go through the help menu on the website, it seems to pick up our account and then it just diverts me here?

I think I had a webchat option a few days ago, but darn’ed if I know where that link was… I find I’m getting increasingly more and more frustrated for something that isn’t cheap and should be so much easier to use.

Hi, Tim: I apologize for the confusion. The ability to open a support ticket depends on your support plan.

I have opened a support ticket on your behalf. You should receive an email; you may also monitor the status of your tickets in our support portal.

Thanks for getting me a support ticket - we are exploring the implications of our setup having the wrong script injection configured - as possibly this can explain the corruption I am seeing? Although it would seem weird that by limiting my queries to 1 day I still see the wrong data - but I guess we will have to rule this out first.

Stay tuned - I’m keen to use the product properly so we can make correct inferences and not have to resort to giving Google more information to make similar inferences.

I’ve finally managed to talk to NR Support and while my APM is setup correctly, and properly injecting script (most of our instances are correctly using the Lite setting, but one of them is using Pro, and I will change it tonight).

However, we happened to notice what the issue is - it seems that current Chrome browsers are not initialising the “newrelic” javascript object, and so evaluating “” in a console gives an error. Testing this with IE11, gives a proper object, and so this will explain why I am getting skewed data - but now I need to understand what causes this error. In one of our more basic backend applications - we don’t get this error (same framework, language, server) so it would seem that perhaps our main app has introduced some new security settings that have broken things over the last year unnoticed. This error is not related to Lite vs Pro, as we see it in both circumstances.

If anyone has seen this - I would love any suggestions.

I also have an outstanding question with support about how NR handles both Lite and Pro data being sent - as I believe that I will be in this situation for a few days while caches clear out. Hopefully this one is handled cleanly.

Thanks everyone for the help so far, I’m slowly getting there.


1 Like


I hit your application’s login page in both Chrome and IE 11 and can already see what’s happening. You’re getting this error in the console in Chrome that affects our agent script and it looks like several others:

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src ‘nonce-342049ed32a4d093dd3653233e90d508087e127a’ ‘self’ ‘strict-dynamic’

This is what is keeping our agent from running in Chrome. IE doesn’t support the use of nonce so it just ignores it and our script is able to execute.

1 Like

Hi - thanks for chipping in - yes our dev team have reached the same conclusion, and looking around topics here, it seems like its quite nasty to fix this with suggested NR improvements that would make it easier not having had any traction in your roadmap.

Still, lets see what a new day brings and maybe there is a simple way around this.

I wasn’t totally clear from my reading if one of the NR config settings removed the inline script and gave slightly lesser information, but at least got you basic page load, session and browser type characteristics - and this inline script was more for ajax calls and the like, which perhaps I could live with (although its a shame to have something so powerful, but its too hard to use in a secure manner without lots of work)


Hey @tim.mackinnon1,

Just wanted to clarify for anyone else who might be reading - all of the versions of the Browser agent use the inline loader script placed in the <head> element which in turn downloads the full agent from our CDN. The only difference is what each loader script includes and which version of the full agent script it downloads. The lite agent has a much smaller script because it provides quite a bit less functionality, as you note, than the Pro or Pro+SPA agent, but it’s installed in the same way.

I’m going to go ahead and put in a feature request for you as well.