google-ads-java
google-ads-java copied to clipboard
Add Java example for creating a Demand Gen campaign using API V20
This commit introduces a new Java example, AddDemandGenCampaign.java, which demonstrates how to create a Google Ads Demand Gen campaign with a video ad. This example is a port of the equivalent C# version.
The example covers:
- Creation of a campaign budget.
- Creation of a Demand Gen campaign (AdvertisingChannelType.DEMAND_GEN) using Target CPA bidding.
- Creation of an ad group with Demand Gen specific settings (DemandGenAdGroupSettings), including channel controls.
- Creation of necessary assets: a YouTube video asset and a logo image asset.
- Creation of a Demand Gen video responsive ad (DemandGenVideoResponsiveAdInfo) linking the assets and including headlines, descriptions, and business name.
- Bundling all operations into a single
MutateGoogleAdsRequestfor atomic execution. - Command-line arguments for customer ID and video ID.
- Error handling for
GoogleAdsException.
The code uses Google Ads API V20 and follows the established patterns and conventions for Java examples in this repository.