Skip to content

🐛 Fix: Clickio amp-ad vendor: enhanced Page URL Handling for Cached AMP Pages - #40392

Closed
ClickioTech wants to merge 6 commits into
ampproject:mainfrom
ClickioTech:clickio-amp-ad-vendor-update
Closed

ClickioTech wants to merge 6 commits into
ampproject:mainfrom
ClickioTech:clickio-amp-ad-vendor-update

Conversation

@ClickioTech

Copy link
Copy Markdown
Contributor

Problem Description

On cached AMP pages, the Clickio ad unit was sending incorrect URLs. The issue occurred because the ad was using global.context.location.href which returns the cached URL instead of the original canonical URL.

Root Cause

  • AMP Cache serves pages through CDN URLs that don't represent the actual page URL
  • The previous implementation only used global.context.location.href which points to the cached URL

Changes Made

  1. Added fallback URL resolution: Now checks global.context.sourceUrl first, falling back to global.context.location.href if not available
  2. Improved context access: Added clickioGlobal.ampContext = global.context for better access to the global context

…ng code formatting. Removed unused import and adjusted spacing for better readability.
- Added support for retrieving the page URL from `global.context.sourceUrl`
- Introduced `clickioGlobal.ampContext` to store the global context for improved access.
@ClickioTech
ClickioTech deleted the clickio-amp-ad-vendor-update branch September 18, 2025 11:37
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.

1 participant