What meta data fields are available for Event?

Hi API Community.   I'm a complete noob to the Pendo Aggregation API and am having hard time understanding what fields are available to the Event data source.  I've tried to use https://app.pendo.io/api/v1/metadata/schema/event but it just returns what seems are random fields.

 

We have two account level fields and I'd like to sum counts by day by these two fields.

Can anyone provide insight to how to specify these fields in a pipeline?

current using:

{

    "response": {
       "mimeType": "application/json"
   },
   "request": {
       "pipeline": [
           {
               "source": {
                   "pageEvents": null,
                   "timeSeries": {
                       "period": "dayRange",
                       "first": "now()",
                       "count": -5
                   }
               }
           },
           {
               "identified": "visitorId"
           },
           {

                "group": {
                   "group": [
                       "accountId", "day","pageId"
                   ],
                   "fields": {
                       "numEvents": {
                           "sum": "numEvents"
                       }
                   }
               }
           }
       ]
   }
}

  

assuming I need to add custom fields to group section??

0

Comments

3 comments
  • Hi Graham,

     

    https://app.pendo.io/api/v1/metadata/schema/event contains event properties rather than metadata. It's the equivalent of what you'd see under Settings > Event Properties in the UI.

     

    If you want to include visitor- or account-level metadata fields in your event aggs, you'd want to use bulkExpand (https://engageapi.pendo.io/?bash#f7d1e295-e6b9-4c17-8423-362ceaf1cd39)
    {
        "bulkExpand": {
            "accountMetadata": {
                "account": "accountId"
            }
        }
    }
    So using the example you supplied, let's say that you wanted to add in the account field "type" and group on that. Your agg would look something like:
    {
        "response": {
            "mimeType": "application/json"
        },
        "request": {
            "pipeline": [
                {
                    "source": {
                        "pageEvents": null,
                        "timeSeries": {
                            "period": "dayRange",
                            "first": "now()",
                            "count": -5
                        }
                    }
                },
                {
                    "identified": "visitorId"
                },
                {
                    "bulkExpand": {
                        "accountMetadata": {
                            "account": "accountId"
                        }
                    }
                },
              {
                    "group": {
                        "group": [
                            "accountId", "day","pageId","accountMetadata.agent.type"
                        ],
                        "fields": {
                            "numEvents": {
                                "sum": "numEvents"
                            }
                        }
                    }
                }
            ]
        }
    }

    This would give an output that looks something like this:

    {
        "pageId": "HkME1Igl7lcpyDgLb57MxXny8yE",
        "accountId": "123456",
        "day": 1688529600000,
        "numEvents": 2,
        "accountMetadata": {
            "agent": {
                "type": "Free Account"
            }
        }
    },
    0
  • Thanks Alisyn Collins, i'm trying to retrieve two of our custom fields that are on the data mappings page, account level data.  group is Agent if that means anything?     

    0
  • Alisyn Collins   I found my answer in the response object!  thanks for your help

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post