Events by device
GA4 events of the period summed per event and device category, for the audit (carts add_to_cart, purchases purchase, leads form_submit, ...). One item per event with its period total and its devices, both by event count, highest first. Reads google_analytics_events_by_device (date x event x device). Aggregates only. Without eventNames every event of the period is returned. An event without rows in the period is not listed; a period without data answers 200 with an empty events. An environment where google_analytics_events_by_device does not exist yet answers like a period without data: 200 with period and an empty events. Both dates are required; the period spans at most 366 days. Cached for 30 minutes.
ClientIdAuthClientSecretAuthx-client-id<token>Client ID
x-client-secret<token>Client secret
organizationId*stringOrganization identifier (UUID, required)
uuidstartDate*stringFirst day of the period, inclusive (YYYY-MM-DD, UTC). Required.
dateendDate*stringLast day of the period, inclusive (YYYY-MM-DD, UTC). Required. At most 366 days from startDate.
dateeventNames?array<string>GA4 event names to return, comma-separated or repeated (up to 50; letters, digits and underscores, starting with a letter, 40 characters at most). Every event when absent.
items <= 50Successful response
application/json- response
period*events*array<>One item per event with rows in the period, most fired first.
curl -X GET "https://example.com/v1/google-analytics/events-by-device?organizationId=11111111-1111-4111-8111-111111111111&startDate=2026-10-01&endDate=2026-10-02&eventNames=add_to_cart%2Cpurchase%2Cform_submit"{ "period": { "startDate": "2026-10-01", "endDate": "2026-10-31" }, "events": [ { "eventName": "add_to_cart", "eventCount": 200, "keyEvents": 0, "eventValue": 0, "transactions": 0, "byDevice": [ { "device": "mobile", "eventCount": 160, "keyEvents": 0, "eventValue": 0, "transactions": 0 }, { "device": "desktop", "eventCount": 40, "keyEvents": 0, "eventValue": 0, "transactions": 0 } ] }, { "eventName": "purchase", "eventCount": 20, "keyEvents": 20, "eventValue": 2199.75, "transactions": 19, "byDevice": [ { "device": "mobile", "eventCount": 12, "keyEvents": 12, "eventValue": 1200.5, "transactions": 12 }, { "device": "desktop", "eventCount": 8, "keyEvents": 8, "eventValue": 999.25, "transactions": 7 } ] } ]}