Skip to main content
Problem Solver I
August 26, 2024
Solved

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

  • August 26, 2024
  • 1 reply
  • 66 views

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?

 

    This topic has been closed for replies.
    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
    }
    }
    }

     

     

    1 reply

    ronen takAuthorAnswer
    Problem Solver I
    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
    }
    }
    }