Skip to content

Fix comments, date format, and CLI description in add_app_campaign.py - #1107

Open
pattersonlois wants to merge 3 commits into
googleads:mainfrom
pattersonlois:fix-add-app-campaign-example
Open

pattersonlois wants to merge 3 commits into
googleads:mainfrom
pattersonlois:fix-add-app-campaign-example

Conversation

@pattersonlois

@pattersonlois pattersonlois commented Nov 15, 2026 •

Copy link
Copy Markdown
  • Use ISO %Y-%m-%d date format in start_date_time and end_date_time to match the Campaign proto specification, anchored to a single datetime.now() call with explicit timedelta(days=...) units.
  • Clarify in create_ad_group that APP_CAMPAIGN supports audience signals (AdGroupCriterion.audience) rather than prohibiting all ad group criteria.
  • Update the commented-out ad_group_ad.ad.app_ad.images example in create_app_ad to construct an AdImageAsset message with a quoted "INSERT_AD_IMAGE_ASSET_RESOURCE_NAME_HERE" placeholder.
  • Fix grammar in the CLI ArgumentParser description (Adds an App campaign...).
  • Add unit tests in tests/examples/advanced_operations/add_app_campaign_test.py.

@pattersonlois
pattersonlois requested review from a team as code owners November 15, 2026 21:24
@pattersonlois

Copy link
Copy Markdown
Author

Thanks @bobhancockg! Addressed both comments in 3443562:

  • start_date_time / end_date_time: Captured now = datetime.now() once and passed explicit days=1 and days=365 to timedelta.
  • Commented-out app_ad.images snippet: Updated create_app_ad to construct an AdImageAsset (client.get_type("AdImageAsset")) with .asset = "INSERT_AD_IMAGE_ASSET_RESOURCE_NAME_HERE" and append it to ad_group_ad.ad.app_ad.images.
  • Unit tests: Added tests/examples/advanced_operations/add_app_campaign_test.py covering create_budget, create_campaign (verifying ISO %Y-%m-%d formatting and a single datetime.now() call), create_app_ad, and main.

@pattersonlois

Copy link
Copy Markdown
Author

Thanks @bobhancockg! Addressed both comments in 7dce71c:

  • GoogleAdsClient initialization in setUp(): Simplified initialization to pass only credentials and use_proto_plus=True so the test uses the library's default API version.
  • Targeting criteria and ad group assertions: Added assertions in test_main_runs_full_campaign_creation_sequence verifying the location constants (geoTargetConstants/21137, geoTargetConstants/2484), language constants (languageConstants/1000, languageConstants/1003), and AdGroup campaign and status fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants