# Example: Tag Inventory for a Domain This example returns a tag inventory for a specific domain, filtered to only include results from the most recent audit run. It groups by tag, tag vendor, and tag category with several useful metrics about each tag including: number of unique pages that contain the tag, highest observed status code to check for potential failing tags on that domain, and average duration and size of the tag on the page. # Request ```javascript POST to https://api.observepoint.com/v3/reports/grid/tags { // Group by tag name, tag vendor, and tag category "columns": [ { "columnId": "TAG", "groupBy": true }, { "columnId": "TAG_VENDOR", "groupBy": true }, { "columnId": "TAG_CATEGORY", "groupBy": true }, // Aggregates: // - total tag hits across rows that match the group { "aggregateFunction": "count_rows" }, // - number of unique pages where the tag appears { "aggregateFunction": "count_distinct", "aggregatedColumn": { "columnId": "FINAL_PAGE_URL" } }, // - highest status code observed for the tag requests in the group { "aggregateFunction": "max", "aggregatedColumn": { "columnId": "TAG_STATUS_CODE" } }, // - average request duration for the tag in the group { "aggregateFunction": "avg", "aggregatedColumn": { "columnId": "TAG_DURATION" } }, // - average response size for the tag in the group { "aggregateFunction": "avg", "aggregatedColumn": { "columnId": "TAG_SIZE" } } ], // Filters: // 1) only include the most recent audit run // 2) limit to a target domain "filters": { "conditionMatchMode": "all", "conditions": [ { "negated": false, "operator": "integer_in", "filteredColumn": { "columnId": "IS_MOST_RECENT_RUN" }, "args": [1] // 1 means most recent audit run }, { "negated": false, "operator": "string_contains", "filteredColumn": { "columnId": "FINAL_PAGE_URL_DOMAIN" }, "arg": "YOURDOMAINGOESHERE.COM", "wildcardStart": true, "wildcardEnd": true } ], "allAccounts": false }, // Sort by total tag hits, highest first "sortBy": [ { "columnIndex": 3, "sortDesc": true } ], "page": 0, "size": 10000 // up to 10,000 grouped results } ``` ```javascript Grid API Response JSON // Notes: // - Grouped columns are returned as [displayName, internalId] pairs // - Aggregates follow the grouped columns in the order requested { "metadata": { "pagination": { "totalCount": 58, "totalPageCount": 1, "pageSize": 10000, "currentPageSize": 58, "currentPageNumber": 0 }, "headers": [ { "column": { "groupBy": true, "columnId": "TAG" } }, { "column": { "groupBy": true, "columnId": "TAG_VENDOR" } }, { "column": { "groupBy": true, "columnId": "TAG_CATEGORY" } }, { "column": { "aggregateFunction": "count_rows" } }, { "column": { "aggregateFunction": "count_distinct", "aggregatedColumn": { "columnId": "FINAL_PAGE_URL" } } }, { "column": { "aggregateFunction": "max", "aggregatedColumn": { "columnId": "TAG_STATUS_CODE" } } }, { "column": { "aggregateFunction": "avg", "aggregatedColumn": { "columnId": "TAG_DURATION" } } }, { "column": { "aggregateFunction": "avg", "aggregatedColumn": { "columnId": "TAG_SIZE" } } } ] }, "rows": [ [ ["OneTrust CMP Assets", 1462], // TAG ["OneTrust", 402], // TAG_VENDOR ["Privacy & Consent", 14], // TAG_CATEGORY 20582, // total tag hits (count_rows) 1221, // unique pages (count_distinct FINAL_PAGE_URL) 200, // highest status code (max TAG_STATUS_CODE) 75, // avg duration (avg TAG_DURATION) 82 // avg size (avg TAG_SIZE) ], [ ["Google Fonts", 1167], ["Google", 3], ["Content & Site Management", 10], 18702, 1285, 200, 189, 105 ], [ ["LinkedIn Insights", 508], ["Linkedin", 404], ["Digital Measurement", 1], 15340, 1224, 302, 172, 185 ], ... // more rows omitted for brevity ] } ```