Class: Analytics

analytics~Analytics

analytics implementation.

Methods

getFirstVersion() → (nullable) {string}

Returns a string indicating the version of the first ever downloaded resource (as recorded by recordVersion()), for the purpose of cohort analysis.

For privacy reasons, the original value is stripped down to either YYYYMMDD, YYYYMM, or YYYY depending on its age. An -E suffix is appended to the original value if it was recorded on an existing installation.

Source:
Returns:

A string indicating the version of the first ever downloaded resource, or "0" or "0-E" if there is no data, or null in case of a parsing error.

Type
string

isTrusted(url) → {boolean}

Checks whether the given URL is trusted for analytics purposes based on the value of the analytics.trustedHosts preference.

Parameters:
Name Type Description
url string

The URL.

Source:
Returns:

Whether the URL is trusted.

Type
boolean

recordVersion(version)

Records the version of a downloaded resource for the purpose of cohort analysis.

The value of the analytics preference must be set at least to an empty object, otherwise nothing is ever recorded and getFirstVersion() always returns null.

Parameters:
Name Type Description
version string

The version, in YYYYMMDD[HH[MM]] format.

Source: