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?
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.
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.