Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Recency on Active Daily Pings #63

Merged
merged 1 commit into from May 15, 2018
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -254,7 +254,7 @@ class Metrics {
// Type of blocking selected during setup
`&sb=${encodeURIComponent(conf.setup_block.toString())}` +
// Recency, days since last active daily ping
`&rc=${encodeURIComponent(this._getRecency().toString())}`;
`&rc=${encodeURIComponent(this._getRecency(type, frequency).toString())}`;

if (CAMPAIGN_METRICS.includes(type)) {
// only send campaign attribution when necessary
@@ -326,8 +326,8 @@ class Metrics {
*
* @return {number} in days since the last daily active ping
*/
_getRecency() {
if (conf.metrics.active_daily) {
_getRecency(type, frequency) {
if (conf.metrics.active_daily && type === 'active' && frequency === 'daily') {
return Math.floor((Number(new Date().getTime()) - conf.metrics.active_daily) / 86400000);
}
return -1;
ProTip! Use n and p to navigate between commits in a pull request.