Number of dimensions allowed in GA4 data API - google-analytics

While going through the new GA4 data API documentation, I didn't come across any specification for the number of dimensions allowed in a single request.
It seemed like there was no upper limit. This document doesn’t mention an upper limit and states the following:
“In a report request, you can specify zero or more dimensions.”
However when I try executing the v1alpha:runReport API via postman I get this response if I give more than 8 dimensions:
{
"error": {
"code": 400,
"message": "Requests are limited to 8 dimensions within a nested request.\n This request is for 9 dimensions.",
"status": "INVALID_ARGUMENT"
}
}
Has the number of dimensions allowed in a request been reduced to 8? If yes, can you point me to some document that states this?
The earlier UA batchGet API used to allow max 9 dimensions and I was expecting the same limit with the new GA4 data API.
Steps to Reproduce:
Post a request to v1alpha:runReport with more than 8 dimensions:
Request URL: https://analyticsdata.googleapis.com/v1alpha:runReport
Request Auth: A valid bearer token
Request Body:
{
"entity":{
"propertyId":"123456789"
},
"dateRanges":[
{
"startDate":"2021-03-29",
"endDate":"2021-03-29"
}
],
"dimensions":[
{
"name":"eventName"
},
{
"name":"source"
},
{
"name":"medium"
},
{
"name":"hostname"
},
{
"name":"dateHour"
},
{
"name":"deviceCategory"
},
{
"name":"browser"
},
{
"name":"city"
},
{
"name":"country"
}
],
"metrics":[
{
"name":"screenPageViews"
},
{
"name":"userEngagementDuration"
},
{
"name":"eventCount"
}
]
}

The Google analytics GA4 data api is a brand new api, released as part of GA4. As such it has not been reduced to 8 dimensions this is the current limit as it stands
Requests are limited to 8 dimensions within a nested request.
The Google analytics reporting api may allow for additional dimensions and metrics but they are it's a completely different system. You can't compare universal analytics and GA4
Note: i have submitted a note about the lack of documentation to the team

Updated docs state up to 9 dimensions are now allowed.
https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimensions

Related

ga4 measurement protocol new users 0

I have desktop app on Delphi. App send next data to https://www.google-analytics.com/mp/collect:
{
"app_instance_id": "47DA283039DE19AA64A5382C7936AE0F",
"events": [
{"name": "login", "params": {
"engagement_time_msec": "1",
"app_version": "3.5.37",
"client_id": "118"
}}
]
}
Google Analytics showing Active Users and Events. But New Users is 0. Also geolocation is no set.
I find answer, that needed pass a clint_id param ("client_id": "66676792622744477"), but after that GA cause an error:
{
"validationMessages": [ {
"description": "Unable to parse Measurement Protocol JSON payload. : invalid value oneof field 'AnonymousUserIdentifier' is already set. Cannot set 'client_id' for type oneof",
"validationCode": "VALUE_INVALID"
} ]
}
Help me please, whats wrong? How can I track New users and Geo via GA4 measurement protocol?
Try to send user_id information to GA4 Property: https://developers.google.com/analytics/devguides/collection/ga4/user-id?platform=websites

Sabre Revalidate Itinerary with Ancillaries

I'm currently working on the integration of the API to be able to search, confirm the price and book.
Currently we have a problem on the second step:
What I'm trying to get is to have a revalidate response having also all Ancillary and Baggage (hand and hold, also with a fee) to be able to create the page to show the information about the reservation.
I've tried to add the following (in a successfully request):
"TravelPreferences": {
"AncillaryFees": {
"Enable": true,
"Summary": true
},
"TPA_Extensions": {
"VerificationItinCallLogic": {
"Value": "B"
}
}
},
but I'm getting following error:
AIR EXTRAS SUMMARY REQUEST REQUIRES AT LEAST ONE GROUP CODE
Error during Processing
For the luggage, with this part
"Baggage": {
"CarryOnInfo": true,
"Description": true
},
I'll get info about baggage but no prices.
Any idea?
Thank you!

Google Analytics server side call err "The value provided for parameter 'tid' is invalid. using a valid" with measurement ID

I am trying to do a server side call to Google Analytics 4 with a valid Measurement ID (G-0GHN4RGNDQ) it's a test one, so OK to share here, see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#v and the debug call here:
https://www.google-analytics.com/debug/collect?v=1&tid=G-0GHN4RGNDQ&cid=555&t=event&ec=MyCategory&ea=MyAction&el=MyLabel
I get this error
{
"hitParsingResult": [ {
"valid": false,
"parserMessage": [ {
"messageType": "ERROR",
"description": "The value provided for parameter 'tid' is invalid. Please see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters for details.",
"messageCode": "VALUE_INVALID",
"parameter": "tid"
} ],
"hit": "/debug/collect?v=1\u0026tid=G-0GHN4RGNDQ\u0026cid=555\u0026t=event\u0026ec=MyCategory\u0026ea=MyAction\u0026el=MyLabel"
} ],
"parserMessage": [ {
"messageType": "INFO",
"description": "Found 1 hit in the request."
} ]
I can successfully make gtag calls using that same Measurement ID and the events show up in Google Analytics... however I can't seem to get it to work via the /debug/ url above.
Any help appreciated.
You appear to be using the endpoint for
Measurement Protocol (Universal Analytics)
https://www.google-analytics.com/debug/collect?tid=fake&v=1
However yet you state you are trying to use Google Analytics 4 which implies GA4 and not Universal analytics.
You should be using Measurement Protocol (Google Analytics 4)
POST /mp/collect HTTP/1.1
HOST: www.google-analytics.com
Content-Type: application/json
<payload_data>
For validating hits check this page page
Note:
Remember the measurement protocol is used to send Data TO Google Analytics not request data from google analytics.

LinkedIn v2 API: 500 failure when fetching standardized data using projections on multiple organizational entity statistics requests

Problem Description
Projections for the function and seniority standard data fail with a 500 error code and an unknown reason when fetching data from multiple organizational entity statistics endpoints.
Problem Scope
Affected Endpoints
/v2/organizationalFollowerStatistics
/v2/organizationPageStatistics
/v2/brandPageStatistics
Affected Organizational Entities
Organization
Organization Brand
Affected Standardized Data
Functions
Seniority
Sample Request
GET "https://api.linkedin.com/v2/organizationalEntityFollowerStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:PAGE_ID&projection=(elements*(*, followerCountsByFunction*(*, function~), followerCountsBySeniority*(*, seniority~)))"
Sample Response
{
"elements": [
{
followerCountsBySeniority: [
{
"followerCounts": {
"organicFollowerCount": 1,
"paidFollowerCount": 0
},
"function!":{
"message":"URN Resolution failed for unknown reasons.:com.linkedin.r2.RemoteInvocationException:GatewayException{_serviceErrorCode=null}",
"status":500
},
"function":"urn:li:seniority:2"
}
]
},
{
followerCountsByFunction: [
{
"followerCounts": {
"organicFollowerCount": 1,
"paidFollowerCount": 0
},
"function!":{
"message":"URN Resolution failed for unknown reasons.:com.linkedin.r2.RemoteInvocationException:GatewayException{_serviceErrorCode=null}",
"status":500
},
"function":"urn:li:function:2"
}
]
},
...
]
}
Additional Information
Querying the /v2/seniority and /v2/functions endpoints using a GET request with their respective IDs successfully returns the expected data.
Projections for other standardized data (e.g. country, region, industry) work as expected.
Application permission scope granted: "r_emailaddress r_ads r_basicprofile r_liteprofile r_ads_reporting r_organization_social rw_organization_admin r_1st_connections_size"

Discrepancy between the Dimensions & Metrics explorer and Analytics API

There appears to be a discrepancy between the Dimensions & metrics explorer and the Analytics API v4. When adding the metric Transaction revenue together with Product name, SKU, item quantity and unique purchases yields the response
{
"error": {
"code": 400,
"message": "Selected dimensions and metrics cannot be queried together.",
"status": "INVALID_ARGUMENT"
}
}
even though according to the Dimensions & metrics explorer, they should be compatible.
You can try this yourself by visiting https://developers.google.com/analytics/devguides/reporting/core/dimsmets and checking the following dimensions/metrics from the Ecommerce category: ga:ProductSKU, ga:productName, ga:transactionRevenue, ga:itemQuantity and ga:uniquePurchases. The explorer should gray out incompatible dimensions and metrics as you select them but Transaction revenue is shown to be compatible.
I run the query using the endpoint https://analyticsreporting.googleapis.com/v4/reports:batchGet with the following JSON body. I've redacted the view id from the pasted body:
{
"reportRequests":[
{
"viewId":"[REDACTED]",
"dateRanges":[
{
"startDate":"2019-01-01",
"endDate":"2019-03-29"
}
],
"metrics":[
{
"expression":"ga:itemQuantity"
},
{
"expression":"ga:transactionRevenue"
},
{
"expression":"ga:uniquePurchases"
}
],
"dimensions":[
{
"name":"ga:productName"
},
{
"name":"ga:productSku"
}
],
"orderBys":[
{
"fieldName":"ga:itemQuantity",
"sortOrder":"DESCENDING"
}
],
"samplingLevel":"LARGE",
"segments":[],
"pageSize":100000,
"hideTotals":true,
"hideValueRanges":true,
"includeEmptyRows":true
}
]
}
According to the Dimensions & metrics explorer the above query should be OK but it yields the aforementioned 400 response. Removing ga:transactionRevenue from the JSON body yields a valid 200 OK response containing the report based on the parameters listed in the above JSON.
Is there something I'm missing here or is there an error in the explorer combinations?

Resources