Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Specifying OrderBys on RunReportRequest object using Google Analytics Data API (Beta)

Using C#’s Google.Analytics.Data.V1Beta nuget package, how do I set the OrderBys when creating a RunReportRequest object? The property has only { get; } and no set. Perhaps this is not available in the Beta version?

var request = new RunReportRequest
{
    Property = $"properties/xxx",
    Metrics = { new Metric { Name = "screenpageviews" }, },
    Dimensions = { new Dimension { Name = "pagepath" }, },    
    DateRanges = { dateRange },
    // OrderBys
};

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

It’s a RepeatedField having an Add(), so you can use collection intializer syntax:

OrderBys = { new OrderBy(), }

Just as you do in the rest of your code (and please post code as text, not as screenshot).

You can also find code by searching for "OrderBys" in their repo.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading