This project hosts the .NET client library for the Google Ad Manager SOAP API.
For API and client library updates and news, please follow our Google Ads Developers blog: http://googleadsdeveloper.blogspot.com/.
You can learn more about the nuget package manager at http://www.nuget.org. For other distribution options, see the alternative distribution options below.
The and Ad Manager API uses OAuth2 as the authentication mechanism. Follow the appropriate guide below based on your use case.
If you're accessing an API using your own credentials...
If you're accessing an API on behalf of clients...
The binary distribution of the Ads API .NET library consists of a precompiled version of the library as a .NET assembly, code examples for using the library, and library documentation. If you are interested in just using the library and not in its internals, and you don't use nuget package manager in your development environment, then you should download this distribution.
The contents of this distribution are as follows:
lib
- Precompiled assemblies.
- Documentation xmls for the assemblies.
examples
Code examples, in C# and VB.NET (when available).
README
ChangeLog
COPYING
Visual Studio solution file
To run the code examples:
App.config
for the examples project and follow the instructions in the file to enter
required configuration values.App.config
.version.examplename
. For instance, v202308.GetCurrentNetwork
is the command line option to
run GetCurrentNetwork
example in v202308
version of the Ad Manager API.Alternatively, each code example has a main()
method, so you can set the appropriate code example
as the Startup object (Select the Application tab on the Examples Properties dialog and pick
the desired class from the "Startup object" dropdown.).
To use the library in a new project:
examplesApp.config
to your project directory and add it to your project.App.config
. If your application has its own App.config
, then you
need to merge its contents with the contents of examplesApp.config
.// Create an appropriate AdsUser instance.
AdManagerUser user = new AdManagerUser();
// Create the required service.
using (NetworkService networkService = user.GetService())
{
// make calls to service class.
}
You can refer to this wiki article for more details.
See https://github.com/googleads/googleads-dotnet-lib/wiki#logging for details.