Conversions API Gateway for Multiple Accounts Control Plane API: Reference

Get Account Event Metrics by Time Frame

Gets account specific event metrics at Pixel and event level provided admin has access to manage the account.

Schema

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
query HomeViewQuery($tenantId: ID!, $pixelIds: [String!], $timeWindow: Int) {
  tenantQueries(tenantId: $tenantId) {
    eventMetrics(pixelIds: $pixelIds, timeWindowMin: $timeWindow) {
      activity {
        name
        receivedCount
        publishedCount
        lastUpdated
      }
      incoming {
        eventNamesCount
        eventsCount
      }
      outgoing {
        eventNamesCount
        eventsCount
        publishSuccessRate
      }
    }
  }
}
_________________________________________________________________________________________________________
tenantId: ID!
_______________________________________________________________________________________________________
pixelIds: [String!]
_______________________________________________________________________________________________________      
timeWindow: Int
     

Fields

FieldDescription

tenantId
ID

Required

Unique identifier of the account

pixelIds
String

Optional

List of Pixel IDs for which event metrics needs to be fetched

timeWindow
Int

Optional

Time window in minutes (Default value is 60 minutes)


Returns

EventMetricsSnapshot

FieldDescription

id
ID

Identifier for EventMetricsSnapshot -- always EventTrafficSummary:incoming

incoming
EventTrafficSummary

Incoming events summary data

outgoing
ConversionsApiPublishSummary

Outgoing events data

activity
EventActivity

List of event activity

domainActivity
DomainActivity

List of domain activity


Error Codes

CodeDescription

401

Not authorized to view event metrics

500

Internal server error


Sample Request

Query

query HomeViewQuery($tenantId: ID!, $pixelIds: [String!], $timeWindow: Int) {
 tenantQueries(tenantId: $tenantId) {
   eventMetrics(pixelIds: $pixelIds, timeWindowMin: $timeWindow) {
     activity {
       name
       receivedCount
       publishedCount
       lastUpdated
     }
     incoming {
       eventNamesCount
       eventsCount
     }
     outgoing {
       eventNamesCount
       eventsCount
       publishSuccessRate
     }
   }
 }
}
     

Variables

{
 "tenantId": "IaoreXfj",
 "pixelIds": ["18904456377094531"]
}
     

Sample Response

{
   "data": {
       "tenantQueries": {
           "eventMetrics": {
               "activity": [
                   {
                       "name": "Purchase_PN_Mar22_Events",
                       "receivedCount": 4,
                       "publishedCount": 0,
                       "lastUpdated": "1678753252000"
                   }
               ],
               "incoming": {
                   "eventNamesCount": 1,
                   "eventsCount": 4
               },
               "outgoing": {
                   "eventNamesCount": 0,
                   "eventsCount": 0,
                   "publishSuccessRate": 0.0
               }
           }
       }
   }
}