⚠️ This documentation pertains to a preview endpoint. This feature is not yet ready for API consumption and may change.
For inquiries or feedback, please contact us at Glean.

Read document analytics

post/getdocumentanalytics

Read the document analytics information for the given list of Glean Document IDs or URLs specified in the request

SecurityBearerAuth
Request
header Parameters
X-Glean-Auth-Type
string

Auth type being used to access the endpoint (should be non-empty only for global tokens).

X-Scio-Actas
string <email>

Email address of a user on whose behalf the request is intended to be made (should be non-empty only for global tokens).

Request Body schema: application/json

Information about analytics requested.

required
object (Period)
required
Array of objects or objects or objects (DocumentSpec)

The specification for the documents for which analytics will be retrieved.

withClickerCounts
boolean

Whether response should include click information or not. Default is to not include click information.

withFacetAggregations
boolean

Whether the results will include aggregate counts/info for facets like location, department, etc.

withImpressionCounts
boolean

Whether response should include impression information or not. Default is to not include impression information.

withVisitCounts
boolean

Whether response should include visit counts or not. Default is to return only visitor counts.

Responses
200

OK

Response Schema: application/json
Array of objects (DocumentAnalytics)

Analytics for requested documents. There will be one-to-one mapping for documents included in the request.

400

Invalid request

401

Not Authorized

429

Too Many Requests

Request samples
application/json
{
  • "documentSpecs": [
    • {
      • "url": "string"
      }
    ],
  • "dayRange": {
    • "minDaysFromNow": 0,
    • "maxDaysFromNow": 0,
    • "start": {
      • "epochSeconds": 0,
      • "daysFromNow": 0
      },
    • "end": {
      • "epochSeconds": 0,
      • "daysFromNow": 0
      }
    },
  • "withClickerCounts": true,
  • "withImpressionCounts": true,
  • "withFacetAggregations": true,
  • "withVisitCounts": true
}
Response samples
application/json
{
  • "results": [
    • {
      • "documentSpec": {
        • "url": "string"
        },
      • "visitorCount": {
        • "count": 0,
        • "period": {
          • "minDaysFromNow": 0,
          • "maxDaysFromNow": 0,
          • "start": {
            • "epochSeconds": 0,
            • "daysFromNow": 0
            },
          • "end": {
            • "epochSeconds": 0,
            • "daysFromNow": 0
            }
          },
        • "org": "string"
        },
      • "clickerCount": {
        • "count": 0,
        • "period": {
          • "minDaysFromNow": 0,
          • "maxDaysFromNow": 0,
          • "start": {
            • "epochSeconds": 0,
            • "daysFromNow": 0
            },
          • "end": {
            • "epochSeconds": 0,
            • "daysFromNow": 0
            }
          },
        • "org": "string"
        },
      • "userImpressionCount": {
        • "count": 0,
        • "period": {
          • "minDaysFromNow": 0,
          • "maxDaysFromNow": 0,
          • "start": {
            • "epochSeconds": 0,
            • "daysFromNow": 0
            },
          • "end": {
            • "epochSeconds": 0,
            • "daysFromNow": 0
            }
          },
        • "org": "string"
        },
      • "visitCount": {
        • "count": 0,
        • "period": {
          • "minDaysFromNow": 0,
          • "maxDaysFromNow": 0,
          • "start": {
            • "epochSeconds": 0,
            • "daysFromNow": 0
            },
          • "end": {
            • "epochSeconds": 0,
            • "daysFromNow": 0
            }
          },
        • "org": "string"
        },
      • "facetAnalytics": [
        • {
          • "facet": {
            • "fieldName": "type",
            • "values": [
              • {
                • "value": "Spreadsheet",
                • "relationType": "EQUALS"
                },
              • {
                • "value": "Presentation",
                • "relationType": "EQUALS"
                }
              ]
            },
          • "analytics": { }
          }
        ]
      }
    ]
}