Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
42.1.0 - 2026-02-25
-------------------
- Add support and examples for v23_1 of the Google Ads API.

42.0.0 - 2026-01-28
-------------------
- Add support and examples for v23 of the Google Ads API.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ This project hosts the Java client library for the Google Ads API.
<dependency>
<groupId>com.google.api-ads</groupId>
<artifactId>google-ads</artifactId>
<version>42.0.0</version>
<version>42.1.0</version>
</dependency>

## Gradle dependency

implementation 'com.google.api-ads:google-ads:42.0.0'
implementation 'com.google.api-ads:google-ads:42.1.0'

## Documentation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ dependencies {
api 'io.grpc:grpc-protobuf'
api 'com.google.auth:google-auth-library-oauth2-http'
api 'com.google.auth:google-auth-library-credentials'
api platform('com.google.cloud:google-cloud-shared-dependencies:3.56.0')
api platform('com.google.cloud:google-cloud-shared-dependencies:3.57.0')
implementation 'com.google.guava:guava'
implementation 'com.google.auto.service:auto-service:1.0.1'
implementation 'javax.annotation:javax.annotation-api'
Expand Down
2 changes: 1 addition & 1 deletion google-ads-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ dependencies {
// This makes this BOM inherit all dependency versions from the Google Cloud
// BOM. This version is determined based on the current used version of
// google-cloud-shared-dependencies.
api(platform("com.google.cloud:libraries-bom:26.74.0"))
api(platform("com.google.cloud:libraries-bom:26.76.0"))

// Add constraints for all of this project's artifacts.
constraints {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.google.ads.googleads.v23.enums.AssetGroupStatusEnum.AssetGroupStatus;
import com.google.ads.googleads.v23.enums.BudgetDeliveryMethodEnum.BudgetDeliveryMethod;
import com.google.ads.googleads.v23.enums.CampaignStatusEnum.CampaignStatus;
import com.google.ads.googleads.v23.enums.MessagingRestrictionTypeEnum.MessagingRestrictionType;
import com.google.ads.googleads.v23.errors.GoogleAdsError;
import com.google.ads.googleads.v23.errors.GoogleAdsException;
import com.google.ads.googleads.v23.resources.Asset;
Expand All @@ -43,7 +44,8 @@
import com.google.ads.googleads.v23.resources.AssetGroupSignal;
import com.google.ads.googleads.v23.resources.Campaign;
import com.google.ads.googleads.v23.resources.Campaign.AssetAutomationSetting;
import com.google.ads.googleads.v23.resources.Campaign.AssetAutomationSettingOrBuilder;
import com.google.ads.googleads.v23.resources.Campaign.MessagingRestriction;
import com.google.ads.googleads.v23.resources.Campaign.TextGuidelines;
import com.google.ads.googleads.v23.resources.CampaignAsset;
import com.google.ads.googleads.v23.resources.CampaignBudget;
import com.google.ads.googleads.v23.resources.CampaignCriterion;
Expand Down Expand Up @@ -256,6 +258,22 @@ private MutateOperation createCampaignBudgetOperation(long customerId) {
/** Creates a MutateOperation that creates a new Performance Max campaign. */
private MutateOperation createPerformanceMaxCampaignOperation(
long customerId, boolean brandGuidelinesEnabled) {
// [START add_performance_max_text_guidelines]
TextGuidelines textGuidelines =
TextGuidelines.newBuilder()
// Specifies a list of terms that should not be used in any auto-generated
// text assets.
.addAllTermExclusions(ImmutableList.of("cheap", "free"))
// Specifies freeform messaging restriction prompts that will apply to all
// auto-generated text assets.
.addMessagingRestrictions(
MessagingRestriction.newBuilder()
.setRestrictionText("Don't mention competitor names")
.setRestrictionType(
MessagingRestrictionType.RESTRICTION_BASED_EXCLUSION)
.build())
.build();
// [END add_performance_max_text_guidelines]
Campaign performanceMaxCampaign =
Campaign.newBuilder()
.setName("Performance Max campaign #" + getPrintableDateTime())
Expand All @@ -280,6 +298,8 @@ private MutateOperation createPerformanceMaxCampaignOperation(
// Sets if the campaign is enabled for brand guidelines. For more information on brand
// guidelines, see https://support.google.com/google-ads/answer/14934472.
.setBrandGuidelinesEnabled(brandGuidelinesEnabled)
// Sets the text guidelines.
.setTextGuidelines(textGuidelines)
// Assigns the resource name with a temporary ID.
.setResourceName(
ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID))
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading