Skip to main content
Solved

Flows API, Revenue metrics


Forum|alt.badge.img+2

Hi guys,

2 questions.

 

#1 How we can get Flow revenue information via API? If not possible, any plans to make it available?

 

#2 I see that we have Campaigns, anytime soon to expose also creating Flows via API?

 

 

Best answer by Dov

Hi @Slav @ Rush,

Thanks for sharing your question with the Klaviyo Community

At this time it isn't possible to report on revenue by attribution source in this way using our API.  For Flow and Campaign emails, you would instead need to use the "attributed message" dimension to pull metrics attributed to specific messages in your account.  This article provides some API calls that you can use to get started with this: https://help.klaviyo.com/hc/en-us/articles/360040093732-Export-Conversion-Data, and you can also use the Campaign API here to pull a list of message IDs first in order to loop through them with the Metrics API: https://www.klaviyo.com/docs/api/campaigns.

In terms of creating flows via API, at this time, we do not have an API endpoint that can be used to create/copy flows. However, I have submitted a proposal to the product team for consideration. If there is enough interest it could potentially be developed in the future :)

Thanks for being a part of our Community.

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

10 replies

Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • Answer
  • July 2, 2021

Hi @Slav @ Rush,

Thanks for sharing your question with the Klaviyo Community

At this time it isn't possible to report on revenue by attribution source in this way using our API.  For Flow and Campaign emails, you would instead need to use the "attributed message" dimension to pull metrics attributed to specific messages in your account.  This article provides some API calls that you can use to get started with this: https://help.klaviyo.com/hc/en-us/articles/360040093732-Export-Conversion-Data, and you can also use the Campaign API here to pull a list of message IDs first in order to loop through them with the Metrics API: https://www.klaviyo.com/docs/api/campaigns.

In terms of creating flows via API, at this time, we do not have an API endpoint that can be used to create/copy flows. However, I have submitted a proposal to the product team for consideration. If there is enough interest it could potentially be developed in the future :)

Thanks for being a part of our Community.


Forum|alt.badge.img+1
  • Contributor II
  • 4 replies
  • August 29, 2021

Just a follow up to the original question.  Is there any way to get Flow IDs/name for each campaign?  How can I join the flow IDs to the related individual emails that go out for that flow?


Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • August 30, 2021

Hello @NickGuebs,

Thanks for your post.

Exporting the analytics for a certain flow allows you to easily measure and review how successful a flow is. Further, you can analyze the data on message by message basis. 

To export the analytics for a given flow, navigate to the Flows tab of your account. Here, you will see an Export Analytics button at the top.

2019-04-05_15-20-14.png

The export will generate a .csv file containing fields such as the Flow ID, Flow Name, Flow Message ID and more. The same strategy can be used to export campaign analytics. Again, the information contained in the .csv file will include the campaign name and other data relating to the campaign.

I hope that helps!


Forum|alt.badge.img+1
  • Contributor II
  • 4 replies
  • September 10, 2021

Hi @Dov 

Apologies. I should have been clearer in my original message.  I’m referring specifically to exporting data in this way from the API rather than the interface.

Thanks


Forum|alt.badge.img+2
  • Contributor II
  • 4 replies
  • January 25, 2022

@NickGuebs @Dov Is there any update w/r/t this? Specifically, I am also looking to explicitly access Flow Message IDs and Flow Message Names directly via API calls


Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • January 26, 2022

Hi @noteconsole,

Thanks for the message. It takes a bit of effort but it should be do-able:

First you need to get the Flow IDs from the API:

https://a.klaviyo.com/api/v1/flows?api_key=****

Then you can loop over those IDs and for each Flow ID you will want to make this request:

https://a.klaviyo.com/api/v1/flow/FLOW_ID/actions?api_key=****

For each Flow this will return an array of JSON objects, each one represents an "action" from your Flow. You'll want to look for the "type" property of each action, if it is "SEND_MESSAGE" that means it is an email. So for the actions with that "type" you can grab the "id" property which is only a numerical id and not the actual Klaviyo ID. You can make this request with the numerical ID:

https://a.klaviyo.com/api/v1/flow/FLOW_ID/action/NUMERICAL_ACTION_ID/email?api_key=****

The response for that request should include the Flow Message name and the actual Klaviyo ID of the Message.

I hope that helps!


Forum|alt.badge.img+2
  • Contributor II
  • 4 replies
  • February 15, 2022
Dov wrote:

Hi @Slav @ Rush,

Thanks for sharing your question with the Klaviyo Community

At this time it isn't possible to report on revenue by attribution source in this way using our API. 

Hi @Dov, is there any update w/r/t revenue and placed order metrics being available in the Flows and Campaigns API? If not, then if there is any sort of workaround for now I would be very interested!

Thanks!


Forum|alt.badge.img+1
  • Contributor I
  • 4 replies
  • March 2, 2022

HI @Dov 
 

 i am trying to use this but even when the call is successfully done the answer is giving me all 0 cero values , even when i know that those flows ids or messages id have values 

here my call

https://a.klaviyo.com/api/v1/metric/X8K8GZ/export?start_date=2021-11-01&end_date=2021-11-30&unit=week&measurement=value&where=%5B%5B%22%24attributed_message%22%2C%22%3D%22%2C%22Wf6rLC%22%5D%5D&api_key=MYAPIKEY

 


Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • March 3, 2022

Hi @Jolguer,

Thanks for sharing this with us.

I recommend contacting a member of our support team to have a closer look at these particular values within your account. They will be able to help troubleshoot your specific issue further.


Forum|alt.badge.img+2

Is there a way to get the SMS flow message ID? I am seeing that I can use the /email endpoint for emails but what is the endpoint for getting actions of type `SEND_SMS`?