Solved

How to get extra profile values?

  • 15 February 2024
  • 4 replies
  • 34 views

Badge +2

I have a typical profile.  It has some values under “Metrics and insights” as shown in the attachment.  How do I get these values via the API?  When I do a GET against /profile/xyz it doesn’t include this information.  Is it possible to pull this at all?
 

 

icon

Best answer by DavidV 23 February 2024, 05:08

View original

4 replies

Userlevel 3
Badge +7

Hello @kenw232 

 

You will have to use Metrics API to get this data.

More information is available here: https://developers.klaviyo.com/en/reference/metrics_api_overview

Badge +2

Hello @kenw232 

 

You will have to use Metrics API to get this data.

More information is available here: https://developers.klaviyo.com/en/reference/metrics_api_overview


This is wrong.  its more like:

https://a.klaviyo.com/api/profiles/xyz?additional-fields[profile]=predictive_analytics

 
Userlevel 4
Badge +24

Hey, @kenw232! This is a question best suited for the technical geniuses in our Developer Group. I’ve moved the question there so a developer can help guide you from here.

Userlevel 5
Badge +21

Hi @kenw232 ,

I just came across your question and hopefully I am able to help here. 

I don’t believe you can query these actual values directly (but I could be wrong). My first thought here would be to actually get this data directly by calling on the Shopify API. You could either setup an Order Created webhook and sum the values (merging the data by email) or poll orders (REST or GraphQL).

 

The other option if you want to stick only to Klaviyo would be to poll the Events API using the Metric ID (The actual metrics can be found here in the Klaviyo account - for Shopify you would use the Placed Order one):

https://www.klaviyo.com/metric/METRICID/placed-order

You’d still need to SUM them together here though.

One other thing you could consider here (I haven’t used this yet) is using the Query Metric Aggregates API - although I believe this has a 1 year maximum date range. More info on that here.

 

Hope this helps! 

Thanks
David

Reply