Solved

Discrepancies between a same api call with different unit - Metric Export

  • 10 September 2021
  • 2 replies
  • 113 views

Badge +2

Hello Klaviyo’s community,

 

I just need your help to find a solution to my issue.

I’m exporting my data outside from Klaviyo to do my own analysis about clicks/opens regarding specific campaigns/flows.

 

Everything seemed to work, but when i tried a different unit (from month to week) data are not the same for a same date range.

Here is my postman request by day

https://a.klaviyo.com/api/v1/metric/ID_of_my_opened_email_metric_/export?unit=day&measurement=unique&start_date=2021-04-01&end_date=2021-05-01&where=[["$message","=",{{message_id}}]]&api_key={{klaviyo_api_key}}

And here is the result →

    "results": [
{
"segment": "Everyone",
"data": [
{
"date": "2021-04-01 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-02 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-03 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-04 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-05 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-06 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-07 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-08 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-09 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-10 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-11 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-12 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-13 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-14 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-15 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-16 00:00:00",
"values": [
0.0
]
},
{
"date": "2021-04-17 00:00:00",
"values": [
5.0
]
},
{
"date": "2021-04-18 00:00:00",
"values": [
8.0
]
},
{
"date": "2021-04-19 00:00:00",
"values": [
12.0
]
},
{
"date": "2021-04-20 00:00:00",
"values": [
2.0
]
},
{
"date": "2021-04-21 00:00:00",
"values": [
2.0
]
},
{
"date": "2021-04-22 00:00:00",
"values": [
1.0
]
},
{
"date": "2021-04-23 00:00:00",
"values": [
2.0
]
},
{
"date": "2021-04-24 00:00:00",
"values": [
2.0
]
},
{
"date": "2021-04-25 00:00:00",
"values": [
8.0
]
},
{
"date": "2021-04-26 00:00:00",
"values": [
3.0
]
},
{
"date": "2021-04-27 00:00:00",
"values": [
6.0
]
},
{
"date": "2021-04-28 00:00:00",
"values": [
3.0
]
},
{
"date": "2021-04-29 00:00:00",
"values": [
5.0
]
},
{
"date": "2021-04-30 00:00:00",
"values": [
4.0
]
},
{
"date": "2021-05-01 00:00:00",
"values": [
5.0
]
}
]
}
]

 

 

But same call with a different unit
https://a.klaviyo.com/api/v1/metric/ID_of_my_opened_email_metric/export?unit=month&measurement=unique&start_date=2021-04-01&end_date=2021-06-01&where=[["$message","=",{{message_id}}]]&api_key={{klaviyo_api_key}}

Here is the result →

"results": [
{
"segment": "Everyone",
"data": [
{
"date": "2021-04-01 00:00:00",
"values": [
55.0
]
},
{
"date": "2021-05-01 00:00:00",
"values": [
84.0
]
},
{
"date": "2021-06-01 00:00:00",
"values": [
35.0
]
}
]
}
]

 

So for the same call, same date range (2021-04-01), i get →

Api Call 1 68 clicks
Api Call 2 55 clicks

 

Can someone explain me why ?

 

Thanks a lot.
Thomas.

icon

Best answer by retention 10 September 2021, 18:52

View original

2 replies

Userlevel 7
Badge +57

@Thomas_Rodier - I think this is due to the aggregation time frame of the “uniqueness” issue.

Imagine if a unique user (me) clicked 4 times in a month (once per week).

  • Week 1 - Clicked 1 time
  • Week 2 - Clicked 1 time
  • Week 3 - Clicked 1 time
  • Week 4 - Clicked 1 time

In a weekly aggregation, it’ll show a value of 1 - because in a week’s time, I’m unique in that timeframe.

However, in a month aggregation (unique to the month), I’m only 1. 

  • Month 1 - Clicked 4 times, but Unique is 1

So adding up the unique clicks by weeks, is not the same as the unique clicks per month. 

Badge +2

Hello @retention,

Thanks for your answer, it makes sens regarding the way you describe “UNIQUE”.

 

In my point of view, unique is regarding the customer, not customer + date range.

Based on this endpoint (i mean splited by week), i will never be able to find the unique number of customer that at least clicked once in my campaign ?

Reply