Hi, I am trying to retrieve metric aggregates using the endpoints mentioned in https://developers.klaviyo.com/en/reference/query_metric_aggregates . While getting the data for opened emails, How do I exclude Apple Privacy opens? Is there any filtering option? I am using python.
Solved
How to exclude Apple Privacy opens when querying Metric Aggregates using API?

Best answer by Brian Turcotte
Hi
Although there isn’t a direct filter for Apple Privacy Opens from this endpoint, a member of our engineering team did come up with a workaround that could help you out:
- Create a segment of Apple Privacy Opens in Klaviyo:
- Audience > Lists & Segments > Create new Segment:
- What somebody has done > Opened Email > at least once overall time, where Apple Privacy Open = True
- What somebody has done > Opened Email > at least once overall time, where Apple Privacy Open = True
- Audience > Lists & Segments > Create new Segment:
- Although you can’t query metric aggregates by segment, you can by list. So then, you can convert the segment in a list:
- Once it’s created, click on the new “Apple Privacy Opens” segment under Lists & Segments. Then, in the upper right-hand “Manage Segment” menu, click Convert to List.
- Once it’s created, click on the new “Apple Privacy Opens” segment under Lists & Segments. Then, in the upper right-hand “Manage Segment” menu, click Convert to List.
- Then make an API call and Query Metric Aggregates by the List that was converted in step B.
While this should accomplish your use case, the hitch is that you would have to perform these steps every time you make the call since lists aren’t dynamically updated.
I hope this helps, and thanks again for using the Community!
- Brian
Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.