5

I'm running Sitecore 8.1 (Original Release), and I've generated a report that is tracking how many times visitors have seen a variation of an internal ad that is on my site. The basic premise of the campaign is that we put a wiki-banner style ad at the top of every page that Sitecore serves up. We want to track how many times each version of that ad is displayed.

I've written some logic that marks which variation is displayed to the user as part of their interaction on the website. I've also written a report to go back through the interactions and report on how many times each variation is displayed.

Here's my problem: The number of interaction records is much smaller than what Google Analytics has.

Google Analytics: 1.2 million PageViews

Sitecore: 884,000 Interaction Records

This disparity between the 2 systems has caused my leadership (and me as well) to question whether or not I'm reporting on the right information.

What is going on with this? How should the numbers compare between the 2 systems? Am I comparing the wrong numbers?

3
  • If I am not mistaken, Sitecore Analytics is more accurate in this context since it will already know if the current visit is caused by robots and also, same page views will not be registered Commented Apr 3, 2017 at 17:25
  • What do you mean by "same page views will not be registered"? Are you saying that the same page view by the same person will not be counted by Sitecore, but it will be by Google Analytics? Commented Apr 3, 2017 at 17:49
  • Yes. It may be counted if it is after some hours or the next day. I haven't yet see how Sitecore Analytics tracks the visits but if the user keeps on refreshing the same page, Sitecore will not track it as it will think it is a robot. Also, Sitecore already stores a visitor Id for each user which is therefore used to identify the user when surfing the site Commented Apr 3, 2017 at 17:52

4 Answers 4

5

OK, so I've spoken with Sitecore support about this issue, and they were able to help me come up with the answer. The reason for the difference is because of the way that I was counting the interactions. I was running the following query to find out how many pageviews I had (according to Mongo):

db.Interactions.count({"StartDateTime":{$gt: ISODate("2017-03-27T00:00:00:00.000-06:00")}})

According to Sitecore support, this is not the correct query that I should have been running. This counts the interactions, but there could be multiple page views in a single interaction. So in order to get the correct numbers, you have to use a different piece of data in the mongo db collection. Here's a couple of examples.

This will find all of the interactions that just had a single page view.

db.Interactions.find({"StartDateTime":{$gt: ISODate("2017-03-27T00:00:00:00.000-06:00")},"VisitPageCount": 1 })

This will find all of the interactions that have more than 1 page view.

db.Interactions.find({"StartDateTime":{$gt: ISODate("2017-03-27T00:00:00:00.000-06:00")},"VisitPageCount": {$gt: 1}})

So, the moral of the story is that in order to find out how many page views a visitor experienced, you have to write a query to add the VisitPageCount for each interaction record.

I hope that this helps someone else understand how to interpret the analytics data that is stored in Mongo.

4

Another thing to consider- and this could potentially count for a good deal of page views is how Sitecore's algorithm automatically detects bots. A page view is considered a bot if:

  • No mouse movement is observed
  • No touch movement is observed (for mobile)

This is achieved by the visitorIdentification control. This ultimately calls ~/layouts/system/VisitorIdentification.js.

If you review this JavaScript file, you will see that on mousemove or touchstart, a css page is requested: ~/layouts/system/VisitorIdentificationCss.aspx.

When this page is requested, the user is classified as a human. Therefore to put it concisely, you are not a robot if you move your mouse or touch your screen.

Therefore, we can imagine a scenario where users click to visit a site, but then do not interact with it- perhaps opening a background tab, then closing their browser. There is also the possibility of keyboard-only users, especially those that rely on screen-readers. These users will be seen as bots based on Sitecore's automatic bot detection.

This setting can be disabled. However, then the only method of determining bots is via the Sitecore.Analytics.ExcludeRobots.config, which allows you to classify bots by user agent strings or IP adresses.

All and all, this may not account for 26% of traffic missing, but has to account for some of it.

1
  • That's good information to have. I think that will help me as I get closer to fine-tuning my reports. Thanks! Commented Apr 26, 2017 at 21:34
0

This depends in large part on how your Google Analytics view is set up. If you are using a master view with no filters, Google will report all traffic including robots. Sitecore, by default, eliminates robot traffic from its reporting. This alone can account for the difference you're encountering.

From the Sitecore documentation:

Not all incoming requests are counted by Sitecore Analytics. It distinguishes unique users with ASP.NET sessions and browser cookies. Also, it skips robots' sessions. Thus, the number of unique visits in Sitecore Analytics is usually less than Google Analytics reports show.

4
  • I've been told that the robots had been filtered out from the google analytics reports. So that's not it. :( Commented Apr 3, 2017 at 17:48
  • Did you check the troubleshooting link in the article above? Having said that, I just checked for this one page on a site we're running. GA reports 43k views in the past week vs 26k views reported by Sitecore. A lot of things can account for that. E.g. we're currently using the same GA tracking ID for multiple environments, which could skew the numbers (not a best practice, I know). Sitecore might also be more finicky in its robot detection. You must include the VisitorIdentification tag in your layout so it won't overcount robots.
    – maz
    Commented Apr 3, 2017 at 18:20
  • I did check the troubleshooting link, and all of my analytics information seems to be correct, the raw numbers are just quite a bit less than what I'm seeing from Google Analytics, and I'd like to be able to explain the reason why to my executive team. Thank you for your website information, though. That is helpful! I do have the VisitorIdentification tag configured per Sitecore documentation. Commented Apr 3, 2017 at 19:52
  • @KeithVanderVeen remember also that Sitecore (by default) tracks users server-side, whereas Google uses JavaScript tracking. This can also account for some disparities. For instance, if site is cached on a CDN or the user is going through a corporate proxy that is caching the pages, Sitecore might not count all page views.
    – maz
    Commented Apr 3, 2017 at 20:06
0

You will always have variance between two analytics systems, depending on the situation that can range from 0-20%, beyond that, I'd really try to undersand the cause. And generally speaking what I've seen and heard Google Analytics does seem to always show more page views than Sitecore. Also the crawler identification is probably working slightly differently.

The key thing you want to validate is, if the variance is consistent. I.e. week to week, is the variance roughly same? or is there some specific period of time when it's off. At that point you might have had an issue in collecting the Sitecore Analytics.

Also, I'd check if Sitecore.Analytics.ExcludeRobots.config (or similiar) file contains for example internal IPs that have been configured to be filtered.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.