Abuja Digital Studio · Est. 2018
Start a Project
DocsOAmazonCloaked links and geo-routing
Reference

Cloaked links and geo-routing

OAmazonorravo.com/docs/oamazon/links-geo

Cloaked links and geo-routing

OAmazon manages your affiliate links instead of inserting raw amazon.com/dp/<ASIN>?tag=<id> URLs in your posts. Every link is a cloaked /go/<slug>/ URL that redirects with the correct associate tag for the visitor's locale.

Why cloaked links

  • One URL works for any locale (geo routing applies the right marketplace per visitor).
  • Edit destination, UTM, or expiry without touching post content.
  • Track clicks with hashed IP/UA, country, device type.
  • Schedule start/end dates per link.
  • Run A/B tests between displays without re-publishing posts.

Creating a link

php$link = OAM_Links::get_or_create( 'B08N5WRWNW', 'us' );
$url  = OAM_Links::get_cloaked_url( $link['slug'] );
// returns https://yoursite.com/go/<slug>/

Manual creation under Links tab -> New Link lets you set:

  • Custom slug and label.
  • Locale (auto for geo-routed, or pinned to one region).
  • UTM source/medium/campaign.
  • Start/End dates.
  • Redirect status (default 302).

Geo routing

OAM_Geo::get_visitor_locale() resolves the visitor's locale from (in priority order):

  1. The OAM_VISITOR_COUNTRY constant (if defined by a geo-IP plugin).
  2. Cloudflare's CF-IPCountry header.
  3. WP option oam_visitor_locale (per-session).
  4. Browser's Accept-Language header.
  5. The configured Default Locale in Settings.

When geo routing is enabled (link has geo_enabled = 1) and the visitor's resolved locale differs from the link's pinned locale, the redirect uses the visitor's local Amazon storefront with the matching Associates ID from oam_programs.

PA API endpoint map

OAM_API::ENDPOINTS covers 18 locales: us, uk, ca, de, fr, it, es, jp, au, in, br, mx, sg, ae, nl, se, tr, pl. Each maps to a host (e.g. webservices.amazon.de), AWS region, and TLD.

Health checks

OAM_Cron::schedule_all() registers a daily health check that verifies each managed link still resolves (no 404, no out of stock). Status is stored in oam_links.health_status and surfaced in the admin.

Cloaked links and geo-routing · OAmazon Docs | Orravo