Skip to main content

This is the date to return

 {
"dimensions": [
"QYbtD4"
],
"measurements": {
"unique": [
18.0
],
"sum_value": [
0.0
],
"count": [
28.0
]
}
}

As shown, the dimension returns the campaign-messages ID, but I need the campaign ID.
From what I understand, this issue only occurs with SMS campaigns.
Is there a way to retrieve the campaign ID for the SMS campaign?

 

 

Hi @ronen tak

In order to group by campaign, please pass "Campain Name" as the group by. If you group by $message, then the results will be grouped by $message. Please see this page on the list of supported attributes for the metrics aggregates API https://developers.klaviyo.com/en/docs/supported_metrics_and_attributes

I hope this helps!

~Chloe


Hi chloe.strange

Thanks for the response.

It doesn't solve my problem because I want to get the campaign ID
And for some reason, an email campaign returns the ID of the campaign
But campaign-type sms returns the campaign message ID
Why are there differences between them?
Why wouldn't both of them return the campaign ID?


I'm encountering the same issue. For our use case, we need consistent campaign IDs across channels.

@chloe.strange - Is there perhaps a workaround or alternative endpoint we could use to get consistent campaign IDs for both email and SMS campaigns for metric values?


Reply