Skip to content

Conversation

@igorantun
Copy link

@igorantun igorantun commented Jan 8, 2026

Summary

  • Add AdCP-to-GAM macro mapping utilities for tracking URLs in src/adapters/gam/utils/macros.py
  • Map AdCP universal macros ({CACHEBUSTER}, {GDPR}, {AXEM}, etc.) to their GAM equivalents
  • Support multiple GAM macro formats: %%MACRO%% (standard), ${MACRO} (GDPR/TCF), %macro! (expand), %{MACRO} (prebid)
  • Fix impression tracking to use correct GAM fields per creative type:
    • ThirdPartyCreative, ImageRedirectCreative, CustomCreativethirdPartyImpressionTrackingUrls
    • VideoRedirectCreativetrackingUrls with CREATIVE_VIEW event
  • Remove click tracking URL handling (clicks should be tracked via %%CLICK_URL%% macros in snippet per GAM best practices)

Macro Mapping Highlights

AdCP GAM Notes
{CACHEBUSTER} %%CACHEBUSTER%%
{GDPR} ${GDPR}
{CLICK_URL} %%CLICK_URL_ESC%% For snippets
{PLACEMENT_ID} %epid! Expand macro
{AXEM} %{AXEM} Prebid format
{GDPR_CONSENT} passthrough Already filled
{GPP_STRING} passthrough Already filled

Test plan

  • Unit tests for macro mapping and substitution (49 tests in tests/unit/test_gam_macros.py)
  • Unit tests for creative type field mapping
  • Integration tests for tracking URL flow
  • Manual verification with GAM sandbox environment

🤖 Generated with Claude Code

Add AdCP-to-GAM macro mapping utilities for tracking URLs:
- Map AdCP universal macros ({CACHEBUSTER}, {GDPR}, etc.) to GAM equivalents
- Support multiple GAM macro formats (%%MACRO%%, ${MACRO}, %macro!)
- Passthrough unmapped macros to preserve third-party tracking
- Fix tracking URL field path in creatives manager

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

All contributors have agreed to the IPR Policy. Thank you!
Posted by the CLA Assistant Lite bot.

@igorantun
Copy link
Author

I have read the IPR Policy

@igorantun igorantun marked this pull request as draft January 8, 2026 21:27
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@igorantun igorantun force-pushed the igorantun/tracking-pixels branch from 3784539 to 029a784 Compare January 12, 2026 17:26
@igorantun igorantun marked this pull request as ready for review January 12, 2026 17:41
Copy link
Contributor

@bokelley bokelley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure click urls work with GAM click tracking, that imp trackers fire properly, and that axem is filled out. use wonderstruck

- Fix impression tracking for ImageRedirectCreative and CustomCreative
  to use thirdPartyImpressionTrackingUrls field
- Fix VideoRedirectCreative to use trackingUrls with CREATIVE_VIEW event
- Map {AXEM} to %{AXEM} (prebid macro format)
- Remove click tracking URL handling - clicks should be tracked via
  macros in the creative snippet per GAM documentation
- Add unit tests for creative type field mapping

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

3 participants