Debugging HTAG
Overview
Section titled “Overview”This guide covers various techniques and tools available for debugging HTAG implementations, including URL parameters, console logging, and other utilities that can help diagnose issues.
Blocking Placements with ast_override_div
Section titled “Blocking Placements with ast_override_div”The ast_override_div URL parameter allows specific ad placements to be blocked from rendering.
How It Works
Section titled “How It Works”Add the ast_override_div parameter to the page URL. The parameter accepts a comma-separated list of elementId:creativeId pairs. Any placement with a creativeId value of '0' will be blocked and will not render.
Example
Section titled “Example”With a URL containing:
https://example.com/page?ast_override_div=div-1:0,div-2:123,div-3:0- Placements with IDs
div-1anddiv-3will be blocked (not rendered) - Placement with ID
div-2will force render Xandr with creative123.
Test Mode with apn_test=TRUE
Section titled “Test Mode with apn_test=TRUE”The apn_test=TRUE URL parameter enables test mode for Xandr (AppNexus) ad requests, disabling antifraud protection and impression counting.
How It Works
Section titled “How It Works”When apn_test=TRUE is present in the URL, HTAG enables test mode for all Xandr ad requests. This parameter:
- Disables antifraud protection mechanisms
- Prevents impressions from being counted in analytics
- Allows unrestricted testing without affecting production metrics
Example
Section titled “Example”Add the parameter to any page URL:
https://example.com/page?apn_test=TRUEThis will enable test mode for all Xandr placements on that page.
Usage Notes
Section titled “Usage Notes”- Only use
apn_test=TRUEduring development and testing phases - Do not enable this parameter in production environments
- Test mode prevents analytics pollution during development
Force Bidder Parameters with adnz_force_bidder
Section titled “Force Bidder Parameters with adnz_force_bidder”The adnz_force_bidder URL parameter allows you to control which bidders participate in the ad auction for specific placements, providing granular control for testing and debugging purposes.
How It Works
Section titled “How It Works”Add the adnz_force_bidder parameter to the page URL to specify which bidders should be active for specific placements or globally across all placements. This feature filters the bidder list before the auction begins.
Syntax
Section titled “Syntax”The parameter accepts a sophisticated syntax for specifying bidder constraints:
Basic Format: ?adnz_force_bidder=<placement>:<bidder1>,<bidder2>
Supported Patterns:
- Single placement, single bidder:
placement1:google - Single placement, multiple bidders:
placement1:google,appnexus - Multiple placements:
placement1:google;placement2:appnexus,xandr - Wildcard (all placements):
*:xandr
Examples
Section titled “Examples”Force specific bidders for one placement:
https://example.com/page?adnz_force_bidder=main-banner:appnexus,xandrOnly AppNexus and Xandr will bid on the main-banner placement.
Configure different bidders per placement:
https://example.com/page?adnz_force_bidder=header:google;sidebar:appnexus,xandrheaderplacement: only Googlesidebarplacement: only AppNexus and Xandr
Apply globally to all placements:
https://example.com/page?adnz_force_bidder=*:xandrOnly Xandr will bid on all placements.
Disable all bidders:
https://example.com/page?adnz_force_bidder=*:googleSpecifying google as the only bidder disables all prebid.js bidding.
Special Behaviors
Section titled “Special Behaviors”Wildcard Priority: When a wildcard rule (*:bidders) is present, it takes precedence over any specific placement rules.
Google Bidder: When google is specified as the only allowed bidder, the system disables all prebid.js bidders for that placement.