Soenneker.Google.DataManager.Client 4.0.4

Prefix Reserved
dotnet add package Soenneker.Google.DataManager.Client --version 4.0.4
                    
NuGet\Install-Package Soenneker.Google.DataManager.Client -Version 4.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Google.DataManager.Client" Version="4.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Google.DataManager.Client" Version="4.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Google.DataManager.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Google.DataManager.Client --version 4.0.4
                    
#r "nuget: Soenneker.Google.DataManager.Client, 4.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Google.DataManager.Client@4.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Google.DataManager.Client&version=4.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Google.DataManager.Client&version=4.0.4
                    
Install as a Cake Tool

Soenneker.Google.DataManager.Client

A lazy, thread-safe Data Manager service provider using IGoogleCredentialsUtil, matching the Google Indexing Service library. Targets .NET 10.

Registration and use

using Soenneker.Google.DataManager.Client.Registrars;

services.AddGoogleDataManagerClientUtilAsSingleton();

Registration also adds the shared credential utility. AddGoogleDataManagerClientUtilAsScoped() registers both the client provider and credential utility per scope.

Place your service-account JSON beneath the application's LocalResources directory and ensure your application copies it to its output directory. Keep the credential out of source control and packages. Enable the Data Manager API and grant the service account access to the destination advertising account.

using Google.Apis.DataManager.v1;
using Soenneker.Google.DataManager.Client.Abstract;

public sealed class Example(IGoogleDataManagerClientUtil provider)
{
    public async Task UseClient(CancellationToken cancellationToken)
    {
        DataManagerService service = await provider.Get("google-sales.json", cancellationToken);
        // Execute requests through service.Events or service.RequestStatus.
        // The provider owns this service; do not dispose it here.
    }
}

Get(fileName) passes the filename and https://www.googleapis.com/auth/datamanager scope to IGoogleCredentialsUtil. Credentials are loaded from LocalResources and cached by filename/scopes. Data Manager clients are separately cached by filename, so concurrent calls for the same file share a service and different files get different services.

Remove(fileName) and RemoveSync(fileName) remove and dispose a cached client. They do not invalidate the credential utility's separate cache. For credential rotation, remove the matching filename/scope entry from IGoogleCredentialsUtil as well before recreating the client. Finish in-flight requests before removing clients or disposing the provider. The provider does not dispose injected credentials; DI manages their lifetime.

Build and verify

dotnet build
dotnet test --project test/Soenneker.Google.DataManager.Client.Tests -- --treenode-filter "/*/*/GoogleDataManagerClientUtilTests/*"

Tests use a fake credential provider and require no Google account.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Google.DataManager.Client:

Package Downloads
Soenneker.Google.DataManager.Conversions

Uploads sales and offline conversion events through the Google Data Manager API.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.4 0 9/18/2026