Environment

Adobe Analytics

Adobe AppMeasurement.js

Question

What is the use of math.random() in Adobe AppMeasurement.js?

Answer

Math.random() is used for three purposes including:

  1. Sampling: Depending on the implementation, some information could be gathered for only a small percentage of the visitors.  Math.random() is used to determine, if a visitor should send the hit information or not.
  2. Fallback Visitor ID: If the visitor id cannot be retrieved from cookies, a random visitor id is generated. It could happen, if the user has cookies disabled (it uses two calls to math.random())
  3. Cache Busting: A random number is added to the end of requests to prevent browser caching.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy