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

GH-2072: Add subscription interval to ping params and change UpgradePlan CTA link params #586

Merged
merged 8 commits into from Jul 27, 2020

Add subscription interval to ping params

  • Loading branch information
benstrumeyer committed Jul 27, 2020
commit 6d1d37b3670c3ccd25a5cf8e943fedc4826e6da2
@@ -371,6 +371,8 @@ class Metrics {
// New parameter for Ghostery 8.5.2
// Hub Promo variant
`&hp=${encodeURIComponent(Metrics._getHubPromoVariant().toString())}`;
// Subscription Interval
`&si=${encodeURIComponent(Metrics._getSubscriptionInterval().toString())}`;
This conversation was marked as resolved by wlycdgr

This comment has been minimized.

@wlycdgr

wlycdgr Jul 27, 2020
Member

There's a matching param on the metrics-server side or a PR to add one, yah?

This comment has been minimized.

@benstrumeyer

benstrumeyer Jul 27, 2020
Author Contributor

Yup, the PR is here. https://github.com/ghostery/metrics_server/pull/25. Good catch, I think we need to update the param name to subscription_interval. Let's do that here to get 8.5.2 out the door quicker

This comment has been minimized.

@wlycdgr

wlycdgr Jul 27, 2020
Member

Good idea


if (CAMPAIGN_METRICS.includes(type)) {
// only send campaign attribution when necessary
@@ -550,6 +552,27 @@ class Metrics {
}
}

/**
* Get the Int associated with the users subscription interval
* @private
* @return {number} String associated with the users subscription interval
*/
static _getSubscriptionInterval() {
const subscriptionInterval = conf && conf.account && conf.account.subscriptionData && conf.account.subscriptionData.planInterval;

if (subscriptionInterval) {
switch (subscriptionInterval) {
case 'month':
return 1;
case 'year':
return 2;
default:
return 0;
}
}
return 0;
}

/**
* Calculate remaining scheduled time for a ping
*
ProTip! Use n and p to navigate between commits in a pull request.