URL Handling
Overview
Section titled “Overview”The URL resolution process follows this hierarchy:
- First, checks for a meta canonical URL (
<meta name="adnz-canonical-url">) - If not found, checks for a link canonical URL (
<link rel="canonical">) - If neither canonical URL is found, falls back to the actual page URL (
window.location.href)
The URL handling mechanism in HTAG is used in several key areas:
Automatic Keywords Generation
Section titled “Automatic Keywords Generation”HTAG extracts keywords from the URL path for ad targeting purposes. When the canonical URL is used, this ensures consistent keyword generation across different URL variations that represent the same content. This is very important for mobile app wrappers, where the real URL could be very different. These keywords are then passed to ad servers for more precise targeting.
URL-based Disabling Rules
Section titled “URL-based Disabling Rules”HTAG can disable ads on specific URLs based on configured rules. The system checks both canonical URLs and actual URLs against these rules.
Dynamic Placements
Section titled “Dynamic Placements”Dynamic placements can be configured to appear only on pages matching specific URL patterns. HTAG uses regular expressions to test if the current URL matches the placement’s URL pattern.