Google Analytics Anomalous Behavior

1

I use Google Analytics on my site but it has an anomalous behavior:

  • When I open 2 to infinite pages of my site in a single browser it is computed as a single active user.
  • When I open 2 to infinite pages of my site in 2 browsers are computed as 2 active users.
  • When I close the pages, the number of active users in the site is not updated.
  • When I leave the flaps open without any update or redirection the number of online users is updated to 0.

I'm using an asynchronous and optimized google analytics code (I put it in an external .js file (which contains other javascript functions, but there is no Interference between variables)):

var _gaq = [['_setAccount', 'UA-63633330-1'], ['_trackPageview']];
(function(d, t){
    var g = d.createElement(t),
        s = d.getElementsByTagName(t)[0];
    g.src = 'http://www.google-analytics.com/ga.js';
    s.parentNode.insertBefore(g, s);
}(document, 'script'));

What is the reason for this anomalous behavior or is this the right behavior?

Link to the site that made the optimized version of Google Analytics available: link

    
asked by anonymous 10.06.2015 / 14:20

1 answer

2

We can say that yes, all of them seem to me to be "correct" with the logic of most online accountants, I hope this helps:

>
  

Q: When I open 2 to infinite pages of my site in a single browser it is computed as a single active user.

  • R: Yes they are considered unique because they are required to make the metric and generally used to define the customer's step-by-step, for example in a shopping site if the user opens multiple windows or tabs you'll need to check where it went until you hit goal (in this example it would complete the purchase)
  

Q: When I open 2 to infinite pages of my site in 2 browsers they are computed as 2 active users.

  • R: Each browser has a User-Agent technologies that the user is using to navigate) and also do not use the same session / cookies, so it is not possible to determine that they are different users. They could even use IP, but if two computers use the same NET the IP will be the same and this would cause unrealistic (mixed) conflicts and data.
  

Q: When I close the pages, the number of active users on the site is not updated.

  • A: The browser has a javascript event called window.onbeforeunload , but it only works well on the front-end , if you use it to make an ajax request for example, the moment you close the browser it will call ajax but it will not take time of completing the delivery of the request on the server, sometimes it succeeds, but it is not guaranteed. They could use it to assist, but instead they use an approximate time of one minute to check the user's activities, if the user closed the browser, after one minute it is removed from the "amount of users online" and this is the most guaranteed process to function today.
  

Q: When I leave the opened tabs without any updates or redirects the number of online users is updated to 0.

  • R: It is the same as the previous one, if the user is inactive on the site even if with open tabs, the accountant should disregard the user after a minute (approx.). activity within the site, if the user is on another tab does not have to account for it. At the time it executes an activity the counter updates.

Conclusion

Browsers may fail, there may be power outages, so the "one minute" system is best to check if the user is active compared to the event window.onbeforeunload . Note that this "method" is not just google, but other similar and even simpler systems use the same procedure (like those online visitor support chats)

    
20.06.2015 / 20:57