Skip to content

Conversation

@BaiyuScope3
Copy link
Collaborator

@BaiyuScope3 BaiyuScope3 commented Jan 16, 2026

Problem

Erin had issue when approving a media buy for GAM , error message

Media buy approved but adapter creation failed: Adapter creation failed: AXE include key 'axei' not found in GAM. Create the custom targeting key in GAM UI and sync using 'Sync Custom Targeting Keys' button.

Event after the targeting key updated in the GAM IU, still showing the same error.

The root cause is below:
When clicking 'Sync Targeting Data' in the Targeting Browser:

  1. Keys are written to gam_inventory table (for UI display) ✅
  2. But adapter_config.custom_targeting_keys column is NOT updated ❌
  3. Media Buy approval calls GAMTargetingManager.resolve_custom_targeting_key_id() which reads from adapter_config.custom_targeting_keys
  4. Result: "AXE include key 'axei' not found in GAM" error even though keys exist

Solution

After writing custom targeting keys to gam_inventory, also update adapter_config.custom_targeting_keys with the key name → GAM ID mapping.

Changes

  • Added _update_adapter_config_targeting_keys() method to gam_inventory_service.py
  • Called the method in background_sync_service.py after writing targeting keys to database

Testing

  • All existing unit tests pass
  • Imports verified working
  • Manual testing: Click 'Sync Targeting Data' → adapter_config.custom_targeting_keys should now be populated

When clicking 'Sync Targeting Data' in the Targeting Browser, custom
targeting keys were written to gam_inventory table but not to
adapter_config.custom_targeting_keys column. This caused Media Buy
approval to fail with 'AXE include key not found' error because
GAMTargetingManager.resolve_custom_targeting_key_id() reads from
adapter_config.

This fix adds a new helper method _update_adapter_config_targeting_keys()
that builds the key name → GAM ID mapping from gam_inventory and stores
it in adapter_config.custom_targeting_keys after the sync completes.
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