Skip to main content
Solved

Filtering limitations with Query Event Data endpoint


Forum|alt.badge.img+3
  • Active Contributor I
  • 14 replies

Hi!

I am actually working with the Query Event Data endpoint https://developers.klaviyo.com/en/reference/metric-export. My goal is to get metric values, like number of Clicked Emails, number of Received Emails by Campaign Name, etc. This endpoint is perfect for that, except for the filtering limitations: I would like to be able to get, for example, Received Emails by Campaign Name and to be able to filter on the Email Domain, but with this endpoint, it’s impossible because I cannot use the “by” and “where” fields at the same time. 

I thought about doing the filtering manually, but for that, I would need to have a response with both the Campaign Name and the Email Domain values for each metric, and it’s impossible with the Query Event Data endpoint (as far as I can see).

So I was wondering if you had a workaround so I could be able to do that? Like another endpoint or other solution I haven’t thought about?

Thank you! :)

Best answer by David To

Hello @Nymesia,

Welcome to the Klaviyo Community!

Great observation! As part of the Query Event Data endpoint, both the Where and By parameters cannot be specified at the same time. However, I believe an additional limitation of what you’re trying to accomplish is the filter itself. What I mean by this is I believe your goal of trying to find users who have received a specific email who has a specific email domain should actually be two separate quarry types.

The Query Event Data endpoint can accomplish the first part of your goal of finding members who have received an email from a specific campaign. The second part of your goal of filtering off of users with a specific email domain would actually be more related to profile properties and would require a separate quarry.

Another way to understand this and a viable solution to accomplish your goal is through segmentation. You can locate users who have received a specific campaign who contain a specific email domain by using the segmentation rules: “What someone has done, received email at least once overall times where campaign equals X AND Properties about someone, where Email contains X”. Note how you need two rules to achieve this goal - one focused on the metric itself and the other on the properties about someone. 

I hope this helps!

David

View original
Did this topic or the replies in the thread help you find an answer to your question?

2 replies

David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2456 replies
  • Answer
  • October 7, 2022

Hello @Nymesia,

Welcome to the Klaviyo Community!

Great observation! As part of the Query Event Data endpoint, both the Where and By parameters cannot be specified at the same time. However, I believe an additional limitation of what you’re trying to accomplish is the filter itself. What I mean by this is I believe your goal of trying to find users who have received a specific email who has a specific email domain should actually be two separate quarry types.

The Query Event Data endpoint can accomplish the first part of your goal of finding members who have received an email from a specific campaign. The second part of your goal of filtering off of users with a specific email domain would actually be more related to profile properties and would require a separate quarry.

Another way to understand this and a viable solution to accomplish your goal is through segmentation. You can locate users who have received a specific campaign who contain a specific email domain by using the segmentation rules: “What someone has done, received email at least once overall times where campaign equals X AND Properties about someone, where Email contains X”. Note how you need two rules to achieve this goal - one focused on the metric itself and the other on the properties about someone. 

I hope this helps!

David


Forum|alt.badge.img+3
  • Author
  • Active Contributor I
  • 14 replies
  • October 7, 2022

Hi David!

 

Thank you so much for your answer! It makes a lot of sense actually, I get why the endpoint has been made that way then.

 

Thanks again, that helps a lot! Have a great day :)

 

Marie