Tony McCreath
Tony McCreath

Reputation: 3399

GA4 Admin API for .Net throwing Internal error on CustomDimensions.Patch

I'm trying to update a GA4 dimension via the GA4 API using the .Net library. I've got to the point where it responds with an Internal Error, so not much of a clue why it is failing. Very similar code works fine for patching a CustomMetric.

var service = new GoogleAnalyticsAdminService(...); 

var request = service.Properties.CustomDimensions
    .Patch(new GoogleAnalyticsAdminV1alphaCustomDimension()
    {
        Description = "Same description",
        DisplayName = "New display name"
    }, "properties/1234567890/customDimensions/1234567890");

request.UpdateMask = "description,display_name";

await request.ExecuteAsync(cancellationToken); 

// Causes:
// Google.GoogleApiException
//   HResult=0x80131500
//   Message=Google.Apis.Requests.RequestError
// Internal error encountered. [500]
// Errors [
//  Message[Internal error encountered.] Location[ - ] Reason[backendError] Domain[global]
// ]

Upvotes: 1

Views: 248

Answers (1)

Ilya Kuleshov
Ilya Kuleshov

Reputation: 584

Tony,

Thank you for reporting this, we will update this thread once the issue is fixed.

Ilya, The Google Analytics API Team

Upvotes: 1

Related Questions