Hello @leggok I am not sure which Programming Language you are using to pull this data.
Here is a JavaScript example of how to calculate overall Open Rate, Click Rate and Conversion Rate
function calculateOverallRates(emailData) {
let totalOpenRate = 0;
let totalClickRate = 0;
let totalConversionRate = 0;
let totalEmails = emailData.length;
emailData.forEach(email => {
totalOpenRate += email.statistics.open_rate;
totalClickRate += email.statistics.click_rate;
totalConversionRate += email.statistics.conversion_rate;
});
let overallOpenRate = totalOpenRate / totalEmails;
let overallClickRate = totalClickRate / totalEmails;
let overallConversionRate = totalConversionRate / totalEmails;
return {
overallOpenRate,
overallClickRate,
overallConversionRate
};
}
const emailData = a
{
groupings: {
flow_id: 'L8Cyh6',
send_channel: 'email',
flow_message_id: 'H6ax8t'
},
statistics: { open_rate: 0.66667, click_rate: 0.0303, conversion_rate: 0 }
},
{
groupings: {
flow_id: 'Hmi77Z',
send_channel: 'email',
flow_message_id: 'HiM4kD'
},
statistics: {
open_rate: 0.62069,
click_rate: 0.03448,
conversion_rate: 0.01149
}
}
];
const overallRates = calculateOverallRates(emailData);
console.log('Overall Open Rate:', overallRates.overallOpenRate);
console.log('Overall Click Rate:', overallRates.overallClickRate);
console.log('Overall Conversion Rate:', overallRates.overallConversionRate);
Hi @Maxbuzz thanks for your answer, I already tried to do this, but if I calculate it, I get values that differ from what I see in the UI version
Open Rate:
UI - 49.5
My value - 54.7 (already * 100)
Click Rate:
UI - 6.34
My value - 7.8 (already * 100)
Conversion Rate:
UI - 1.95
My value - 2.35(already * 100)
could this be a deviation? but in my opinion it is too big
Hey @leggok, it’s not currently possible to export numbers that would match the UI precisely across all flows via the API. With the Flow Reporting API, as you’ve noted, you can get these stats on a per-flow/flow-message basis.
You can approximate it, but if you try to aggregate across ratio metrics the number you get in the end will not equal the number we’d get by aggregating across the raw data for all flows. You’re essentially averaging these out.
Can you share more context on what exactly you’d do with these stats, if you could access them programmatically?