google-ads-dotnet icon indicating copy to clipboard operation
google-ads-dotnet copied to clipboard

Unable to get Upload Date from my Offline Conversion : Daily Summary, using the new OfflineConversionUploadClientSummary report in V15

Open JMariaccia opened this issue 1 year ago • 2 comments

Describe the bug: I'm trying to implement a service for my Offline Conversion using the new OfflineConversionUploadClientSummary report. I'm trying to Query data from this page : image

When i query my OfflineConversionUploadClientSummary and parse all my OfflineConversionUploadClientSummary .daily_summaries[], they don't have any uploading Date available, accordingly to the doc i should have either job_id or upload_date image

but any of my daily summary got thoses information : image image Is this suppose to happen ?

Am i querying the right endpoint ?

Steps to Reproduce:

Here is my service :

` using Google.Ads.GoogleAds.V15.Services; using GoogleAdsDataLayer.Models.QueryBuilder.Format; using GoogleAdsDataLayer.Models.QueryBuilder.Queries; using GoogleAdsDataLayer.Models.Requests; using System; using System.Collections.Generic;

namespace GoogleAdsDataLayer.Services.OfflineConversion { public class OfflineConversionUploadClientSummaryService : GoogleAdsService<OfflineConversionUploadClientSummaryService>, IOfflineConversionUploadClientSummaryService { public OfflineConversionUploadClientSummaryService() { Endpoint = "offline_conversion_upload_client_summary"; }

    public IEnumerable<GoogleAdsRow> GetOfflineConversionsUploadClientSummary(Request request)
    {
        return PerformQuery(new Query(request, Endpoint));
    }

}

} `

and how i query my data :

` protected readonly IOfflineConversionUploadClientSummaryService _offlineConversionService = UsmServiceProvider.GetGoogleAdsService<IOfflineConversionUploadClientSummaryService>();

var request = new Request(long.Parse(accountId)) { Fields = new List { "customer.id", "customer.descriptive_name", "offline_conversion_upload_client_summary.daily_summaries", "offline_conversion_upload_client_summary.total_event_count", "offline_conversion_upload_client_summary.success_rate", "offline_conversion_upload_client_summary.last_upload_date_time", "offline_conversion_upload_client_summary.successful_event_count", "offline_conversion_upload_client_summary.resource_name" }, };

IEnumerable<GoogleAdsRow> dataRows = _offlineConversionService.GetOfflineConversionsUploadClientSummary(request);`

Please provide a code snippet or steps to consistently reproduce the experienced behavior. [DO NOT INCLUDE ANY PERSONAL OR SENSITIVE DATA IN YOUR SUBMITTED CODE]

Expected behavior: I need to query the success rate of every daily Summary to report when my upload success rate is under a specific threshold using this ` IEnumerable<OfflineConversionSummary> uploadSummariesWithTooManyErrors = dataRows.SelectMany(row => row.OfflineConversionUploadClientSummary.DailySummaries) .Where(summary => IsSuccessRateLowerThanThreshold(summary) && IsUploadDateInRange(summary));

            private bool IsUploadDateInRange(OfflineConversionSummary summary)

{ return DateTime.Parse(summary.UploadDate, new CultureInfo("en-US")) > DateTime.Now.AddDays(-_numberOfDayToAnalyse); }

private bool IsSuccessRateLowerThanThreshold(OfflineConversionSummary summary) { return GetUploadSummarySuccessRate(summary) < _uploadSuccessPercentage; }

private double GetUploadSummarySuccessRate(OfflineConversionSummary uploadSummary) { double totalUpload = uploadSummary.SuccessfulCount + uploadSummary.FailedCount; double successRate = Math.Round(((uploadSummary.SuccessfulCount * 100) / totalUpload), 2);

return successRate;

}`

Client library version and API version: Client library version: Google Ads API version: 17.1.0 .NET version: 4.72 Operating system (Linux, Windows, ...) and version (if the bug is platform-specific): Windowq

Request/Response Logs:

Anything else we should know about your project / environment

JMariaccia avatar Oct 25 '23 10:10 JMariaccia

The request seems fine...This seems more related to an API issue where the upload date is not getting returned.

Do you have a request ID you could share so I could lookup the logs?

AnashOommen avatar Dec 26 '23 18:12 AnashOommen

I have the same issue using Python SDK

This is one of the request IDs for your reference Hx6JyddZIhT17yuG1mVndA

daisuketanabe avatar Jan 22 '24 14:01 daisuketanabe