Skip to main content
Solved

how can I get Revenue from the API as it appeared in the UI

  • August 26, 2024
  • 1 reply
  • 30 views

Forum|alt.badge.img+2

I am using Query Metric Aggregates to get the campaign ID. I use "by": [ "$message" ]

 I want to get the revenue for each campaign that he belongs to. Here, you can see what I want
Do you know how I can do this via the API?

 

Best answer by ronen tak

I found out how to get it Metric Aggregates


    "data": {
        "type": "metric-aggregate",
        "attributes": {
            "measurements": [
                "sum_value"
            ],
            "filter": [
                "greater-or-equal(datetime,2024-08-01)",
                "less-than(datetime,2024-08-30)"
            ],
            "by": [
            "$attributed_message"
],
            "interval": "month",
            "metric_id": "Placed Order",
            "page_size": 500
        }
    }
}

 

 

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

1 reply

Forum|alt.badge.img+2
  • Author
  • Problem Solver I
  • 15 replies
  • Answer
  • August 28, 2024

I found out how to get it Metric Aggregates


    "data": {
        "type": "metric-aggregate",
        "attributes": {
            "measurements": [
                "sum_value"
            ],
            "filter": [
                "greater-or-equal(datetime,2024-08-01)",
                "less-than(datetime,2024-08-30)"
            ],
            "by": [
            "$attributed_message"
],
            "interval": "month",
            "metric_id": "Placed Order",
            "page_size": 500
        }
    }
}