mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Used the higher of click count and open count for email open count (#15508)
fixes https://github.com/TryGhost/Team/issues/2017 We process clicks much faster than we process Mailgun events which can result in a higher click rater than open rate shown on the dashboard. This ensures that the open rate will never be lower than the click rate. This is a stopgap solution until we can get click events updating the opened_at time for email_recipients
This commit is contained in:
parent
b80c2cd81b
commit
1613470a8c
1 changed files with 12 additions and 0 deletions
|
@ -110,6 +110,18 @@ module.exports = async (model, frame, options = {}) => {
|
|||
});
|
||||
}
|
||||
|
||||
if (labs.isSet('emailClicks')) {
|
||||
if (jsonModel.email && jsonModel.count) {
|
||||
jsonModel.email.opened_count = Math.min(
|
||||
Math.max(
|
||||
jsonModel.email.opened_count || 0,
|
||||
jsonModel.count.clicks || 0
|
||||
),
|
||||
jsonModel.email.email_count
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!labs.isSet('memberAttribution') && !labs.isSet('emailClicks')) {
|
||||
delete jsonModel.count;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue