• Stars
    star
    226
  • Rank 176,514 (Top 4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 11 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Google Ad Manager SOAP API Client Library for Java

Google Ad Manager SOAP API Client Library for Java

This project hosts the Google Ad Manager SOAP API client library for Java.

Features

  • Distributed via Maven.
  • Uses the SLF4J logging facade to log requests and SOAP messages, letting you plug in a concrete logging framework of your choice.
  • Automatic handling of SOAP headers.
  • Easy management of credentials, authentication, and session information.
  • JavaDoc

Requirements

  • Java 1.8+
  • Maven 3.0+ not required, but recommended

Announcements and updates

For API and client library updates and news, please follow our Google Ads Developers blog.

Support forum

If you have questions about the client library or the API, you can ask them on our forum:

Maven artifacts

    <dependency>
      <groupId>com.google.api-ads</groupId>
      <artifactId>ads-lib</artifactId>
      <version>RELEASE</version>
    </dependency>
    <dependency>
      <groupId>com.google.api-ads</groupId>
      <artifactId>dfp-axis</artifactId>
      <version>RELEASE</version>
    </dependency>

Note: The following explanation is for Axis, but the general idea applies to both frameworks.

The ads-lib artifact contains all of the library and utility classes for accessing the Google Ad Manager SOAP API, but does not support any specific SOAP framework. All client library classes and utilities are in the package or sub-packages of com.google.api.ads.common.lib. To add support for the Ad Manager SOAP API using the Apache Axis framework, the dfp-axis plugin artifact is also necessary. This artifact also includes autogenerated classes from the Ad Manager SOAP API. They are in the package com.google.api.ads.admanager.{version}.

Getting started

  1. Configure your project. You have multiple options for this step. While we suggest using Maven, we understand that not all build environments can handle this.

    • If using Maven with Eclipse

      In the releases section download a file like admanager-axis-maven-and-examples-v.vv.vv.tar.gz and extract its contents to a directory.

      Import the Eclipse project by going to File > Import, then General > Existing projects into workspace`, and selecting the extracted folder.

    • If using Maven from the command line

      In the releases section download a file like admanager-axis-maven-and-examples-v.vv.vv.tar.gz and extract its contents to a directory.

    • If using jars

      In the releases section download a file like admanager-axis-jars-and-examples-v.vv.vv.tar.gz and extract its contents to a directory.

  2. Copy the sample ads.properties file to your home directory and fill out the required properties. You can skip the properties ending with clientId, clientSecret, and refreshToken for now. You'll set those in the next step.

  3. Setup your OAuth2 credentials.

    The Ad Manager SOAP 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...

  4. Run an example.

    • If using Maven with Eclipse

      Navigate in your project to any example (for example, src/main/java/admanager/axis/#AD_MANAGER_API_VERSION#/networkservice/GetAllNetworks.java) and run the example.

    • If using Maven from the command line

      This command runs the GetAllNetworks example, but you can update the -Dexec.mainClass argument with the example of your choice.

      Any parameters required for an example to run can be passed on the command line by using -Dexec.args. To see more information about a particular example, use -Dexec.args="--help".

      $ mvn -X exec:java -Dexec.mainClass="admanager.axis.#AD_MANAGER_API_VERSION#.networkservice.GetAllNetworks" -Dexec.args="--help"
      
    • If using jars

      Navigate in your project to any example (for example, src/admanager/axis/#AD_MANAGER_API_VERSION#/networkservice/GetAllNetworks.java) and run the example.

How do I enable logging?

The client library uses SLF4J for all logging. Check out our logging guide on github for more details.

How do I enable compression?

First, add an entry to your ads.properties file for each API you plan to use.

# Ad Manager
api.admanager.useCompression=true

If using JaxWs, no further steps are required.

If using Axis, no further steps are required unless you are setting the axis.ClientConfigFile system property. If you are setting axis.ClientConfigFile to your own custom WSDD file and you want to use compression, ensure that the http transport defined in your WSDD supports compression.

Using a proxy

We recommend setting JVM arguments on your app for your proxy.

https.proxyHost      Hostname of proxy server                      web-proxy
https.proxyPort      Port on server of proxy                       8080
https.proxyUser      Optional username for proxy authentication    someone
https.proxyPassword  Optional proxy server password                secret

These properties can be set with JVM arguments in your Eclipse run configuration:

-Dhttps.proxyHost=web-proxy -Dhttps.proxyPort=8080 -Dhttps.proxyUser=someone
-Dhttps.proxyPassword=secret ...

If necessary, set this up in code like so:

System.setProperty("https.proxyHost", "web-proxy");
System.setProperty("https.proxyPort", "8080");
System.setProperty("https.proxyUser", "someone");
System.setProperty("https.proxyPassword", "secret");

Utilities

Where do I submit bug reports, feature requests and patches?

All of these items can be submitted at https://github.com/googleads/googleads-java-lib/issues.

More Repositories

1

googleads-mobile-android-examples

googleads-mobile-android
Java
1,693
star
2

googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
C#
1,355
star
3

googleads-mobile-ios-examples

googleads-mobile-ios
Objective-C
953
star
4

googleads-python-lib

The Python client library for Google's Ads APIs
Python
678
star
5

googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP
PHP
657
star
6

google-ads-python

Google Ads API Client Library for Python
Python
498
star
7

videojs-ima

IMA SDK Plugin for Video.js
JavaScript
449
star
8

googleads-mobile-flutter

A Flutter plugin for the Google Mobile Ads SDK
Java
341
star
9

google-api-ads-ruby

Ad Manager SOAP API Client Libraries for Ruby
Ruby
297
star
10

google-ads-php

Google Ads API Client Library for PHP
PHP
295
star
11

googleads-ima-html5

Samples for the HTML5 IMA SDK.
JavaScript
260
star
12

googleads-mobile-android-mediation

Sample Android project showcasing how to build a mediation adapter or custom event for the Google Mobile Ads SDK.
Java
240
star
13

googleads-shopping-samples

Samples for the Content API for Shopping and the Manufacturer Center API
Java
192
star
14

google-ads-java

Google Ads API Client Library for Java
Java
167
star
15

google-media-framework-android

[DEPRECATED] The Google Media Framework (GMF) is a lightweight media player designed to make video playback and integration with the Google IMA SDK on Android easier.
Java
155
star
16

googleads-adsense-examples

Samples for the AdSense Management API
Java
142
star
17

swift-package-manager-google-mobile-ads

Swift
133
star
18

googleads-mobile-ios-mediation

Objective-C
118
star
19

googleads-mobile-android-native-templates

Java
116
star
20

googleads-ima-android

Samples for the IMA Android SDK.
Java
114
star
21

googleads-dotnet-lib

Google Ad Manager SOAP API .NET client library
C#
108
star
22

googleads-dfa-reporting-samples

Samples for the DoubleClick for Advertisers Reporting and Trafficking API
C#
106
star
23

googleads-consent-sdk-android

Consent SDK
Java
101
star
24

publisher-ads-lighthouse-plugin

Publisher Ads Audits for Lighthouse is a tool to improve ad speed and overall quality through a series of automated audits. This tool will aid in resolving discovered problems, providing a tool to be used to evaluate effectiveness of iterative changes while suggesting actionable feedback.
JavaScript
98
star
25

google-media-framework-ios

The Google Media Framework (GMF) is a lightweight media player designed to make video playback and integration with the Google IMA SDK on iOS easier.
Objective-C
74
star
26

admob-ads-in-flutter

Dart
73
star
27

google-ads-dotnet

This project hosts the .NET client library for the Google Ads API.
C#
72
star
28

google-ads-ruby

Google Ads API Ruby Client Library
Ruby
70
star
29

googleads-ima-ios

Samples for the iOS IMA SDK.
Objective-C
57
star
30

googleads-bidmanager-examples

PHP
42
star
31

googleads-admob-api-samples

googleads-admob-api-samples
Java
40
star
32

admob-inline-ads-in-flutter

Dart
40
star
33

google-publisher-tag-samples

Google Publisher Tag (GPT) code samples.
TypeScript
36
star
34

googleads-adxbuyer-examples

Samples for the DoubleClick Ad Exchange Buyer REST API
C#
34
star
35

googleads-ima-html5-dai

JavaScript
33
star
36

google-ads-doctor

Go
31
star
37

googleads-consent-sdk-ios

Consent SDK
Objective-C
31
star
38

googleads-adxseller-examples

Samples for the DoubleClick Ad Exchange Seller REST API
Java
20
star
39

googleads-ima-roku-dai

Brightscript
15
star
40

google-ads-perl

Google Ads API Client Library for Perl
Perl
15
star
41

googleads-mobile-ios-native-templates

Objective-C
14
star
42

dfp-playground

JavaScript
14
star
43

googleads-ima-tvos-dai

Objective-C
11
star
44

adwords-scripts-linkchecker

App Engine-based link checker for AdWords Scripts and Apps Script
Java
11
star
45

googleads-ima-cast

Samples for the Chromecast IMA SDK
JavaScript
10
star
46

googleads-displayvideo-examples

Display & Video 360 (DV360) API code samples.
Java
10
star
47

angular-dfp

Semantic DoubleClick integration with AngularJS
JavaScript
10
star
48

authorized-buyers-rtb-api-samples

C#
9
star
49

googleads-dynamic-ad-insertion

JavaScript
9
star
50

googleads-dfp-java-dfp-playground

DFP API Playground
Java
9
star
51

googleads-viewability-insights-extension

A DevTools extension for inspecting the viewability of Ad Manager Ads.
JavaScript
9
star
52

app-conversion-solutions

App Conversion Solutions with Google Ads API
Java
8
star
53

google-publisher-tag-types

Automatically generated TypeScript type definitions for the Google Publisher Tag JavaScript API
TypeScript
8
star
54

mobilevsi-android

Java
7
star
55

googleads-ima-android-dai

Java
7
star
56

googleads-dfa-samples

Samples for the DoubleClick for Advertisers API
PHP
7
star
57

googleads-ima-cast-dai

JavaScript
6
star
58

admob-firebase-codelabs-android

Kotlin
6
star
59

googleads-ima-tvos-client-side

Objective-C
6
star
60

googleads-perl-lib

AdWords API Perl Client Library
Perl
5
star
61

googleads-ima-ios-dai

Objective-C
5
star
62

html5-to-dfp

Python
5
star
63

admob-firebase-codelabs-unity

C#
5
star
64

swift-package-manager-google-user-messaging-platform

Swift
5
star
65

googleads-pal-webapp

An app demonstrating PAL SDK
TypeScript
4
star
66

googleads-ima-tizen-dai

JavaScript
4
star
67

gpt-ad

A Polymer element for defining GPT Ads in Polymer apps.
HTML
4
star
68

swift-package-manager-google-programmatic-access-library-ios

Swift
4
star
69

admob-appopen-unity

C#
3
star
70

swift-package-manager-google-interactive-media-ads-tvos

Swift
3
star
71

gpt-light-ad

HTML
3
star
72

swift-package-manager-google-programmatic-access-library-tvos

Swift
2
star
73

authorized-buyers-marketplace-api-samples

C#
2
star
74

swift-package-manager-google-interactive-media-ads-ios

Swift
2
star
75

conf-data-processing-architecture-reference-sample

2
star
76

hbbtv-lshape-demo

JavaScript
2
star
77

googleads-pal

Java
2
star
78

search-campaign-setup-booster

Python
2
star
79

google-publisher-tag-playground

An interactive code playground for Google Publisher Tag (GPT) samples.
TypeScript
2
star
80

comparison-shopping-service-api-samples

Code samples for the Comparison Shopping Service API (CSS API)
Java
1
star
81

.allstar

1
star
82

.github

1
star