Abuja Digital Studio · Est. 2018
Start a Project
Docs
OAmazon
Context-aware Amazon affiliate ads for WordPress — interest-based targeting, inline & sidebar card layouts, live price fetching, and impression/click tracking.
oamazon
Developer documentation

OAmazon v1.1.1

The professional Amazon affiliate plugin for WordPress. PA-API 5.0 integration, 15 display types, geo-routing across 17 locales, A/B testing with chi-square significance, FTC-compliant disclosures, and end-to-end click analytics.

WordPress plugin 8 database tables Free + Pro v1.1.1 · stable
01 · Overview

What OAmazon does

A first-class Amazon affiliate plugin built for editorial sites: context-aware product cards, statistically rigorous A/B testing, and geo-routing that sends US traffic to amazon.com and UK traffic to amazon.co.uk automatically.

🛒
Live PA-API 5.0
AWS Signature V4 client, transient-cached product data, automatic rate limiting
🎨
15 display types
Cards, grids, comparison tables, sidebars, deal boxes, across three style themes
🌍
17 Amazon locales
US, UK, CA, DE, FR, IT, ES, JP, AU, IN, BR, MX, SG, AE, NL, SE, TR, PL
📊
Statistical A/B testing
Chi-square 2×2 contingency, 95% threshold, automatic winner declaration
⚖️
FTC compliance
Auto-injected disclosures, ToS checker for stale prices and missing labels
📈
Click analytics
Per-link, per-display, per-variant tracking with device + geo + referrer breakdown
OAmazon was previously distributed as fg-amazon-ads. The 1.1.x release rebrands and adds full Orravo Suite integration: OIntel sync, OEngage tracking, OMailer list crossover.
02 · Installation

Getting installed

From WordPress admin

1
Go to Plugins → Add New → Upload Plugin.
2
Upload oamazon.zip and click Install Now, then Activate.

Manual install (FTP / SFTP)

1
Extract oamazon.zip.
2
Upload the oamazon/ folder to /wp-content/plugins/.
3
Activate via Plugins → Installed Plugins.
💡Activation creates 8 database tables (wp_oam_*), seeds the default FTC disclosure, schedules cron jobs, and flushes rewrite rules for slug-based affiliate links.
03 · Quick Start

Up and running in minutes

From plugin install to a live product card embedded in your post.

1
Open OAmazon → Settings → Programs. Enter your Amazon Associates ID, PA-API key, and PA-API secret for at least one locale (start with US).
2
Go to OAmazon → Products → Add New. Paste an ASIN (e.g. B08N5WRWNW). The plugin fetches title, price, image via PA-API.
3
Go to Displays → New Display. Pick Display Type → Card, select the ASIN you just added, set Style → Orravo.
4
Save. Copy the shortcode [oam_display id="123"] from the display row.
5
Paste the shortcode into any post or page. Visit the post; the product card renders inline.

Clicks are tracked from the first impression. View per-link analytics under OAmazon → Analytics.

04 · PA-API 5.0 Setup

PA-API 5.0 setup

OAmazon ships an AWS Signature V4 client (OAM_API class) that signs every request to Amazon Product Advertising API 5.0.

Required credentials per locale

  • Associates ID: your tracking tag (e.g. mysite-20)
  • PA-API Access Key: issued by Amazon Associates Central
  • PA-API Secret Key: paired with the access key

Each Amazon locale (US, UK, etc.) requires its own credentials. Stored encrypted in the wp_oam_programs table.

What the API client fetches

  • Title, brand, bullet points
  • Price (current, list, savings), currency
  • Availability state
  • Rating, review count
  • Images (small, medium, large)
  • Categories
  • Affiliate URL with your tracking tag

Rate limiting & queueing

Amazon enforces 1 request/second per credentials. OAmazon tracks per-credentials throttle in transients. When the limit is hit, overflow requests are written to the oam_api_queue option and processed by cron in the next tick.

Caching

Successful PA-API responses are cached in wp_oam_products with a cached_at timestamp. Subsequent renders use the cache; refresh runs on a schedule to keep prices current.

⚠️Amazon's PA-API has approval requirements. New Associates accounts often need to make their first 3 qualifying sales within 180 days before PA-API is enabled. Until then, OAmazon will display cached data only and cannot fetch new ASINs.
05 · 15 Display Types

15 display types

Pick the visual that fits the editorial context: a single product card, a comparison table, a sidebar widget, a sticky deal strip.

TypeLayoutBest for
cardProduct CardInline product mention in editorial
compactCompact CardSidebar, minimal footprint
buttonMini ButtonInline link with subtle CTA styling
comparisonComparison TableHead-to-head product reviews
rankedRanked List"Top 10" style listicles
gridBestseller GridCategory landing pages
featureFeature BoxHero placement above-the-fold
price_alertPrice Alert StripSticky deal notifications
image_boxImage BoxVisual-first product showcase
shelfProduct ShelfHorizontal scroller of ASINs
editorialEditorial GridMagazine-style multi-card layout
dealDeal BoxTime-sensitive promotions
quoteQuote BoxTestimonial-style with product
tableAffiliate TableSpec / feature comparison
widgetSidebar WidgetPersistent sidebar placement

Display styles

Every display type can be rendered in three style themes: light, dark, or orravo (the editorial theme). Set per-display in the admin or via shortcode attribute.

06 · Geo-Routing

Geo-routing across locales

A US visitor clicks your link → routed to amazon.com. A UK visitor → amazon.co.uk. A German visitor → amazon.de. The Associates ID for that locale is automatically applied.

Detection priority

1
Cloudflare CF-IPCountry request header (most reliable, no DB lookup)
2
Stored IP-to-country map (fallback when Cloudflare not present)
3
Site default locale (configured in Settings)

Country → locale map

LocaleCountries
usUS, PR, VI, GU
ukGB, IE
caCA
deDE, AT, CH
frFR, BE, LU
itIT
esES
jpJP
auAU, NZ
inIN
brBR
mxMX
sgSG, MY
aeAE, SA, EG
nlNL
seSE, NO, DK, FI
trTR
plPL, CZ, SK
ℹ️Geo-routing is enabled per-link via the geo_enabled toggle on each wp_oam_links entry. When disabled, the link always points to the locale where it was created.
07 · A/B Testing

A/B testing with significance

Pit two displays against each other. OAmazon assigns variants client-side, tracks impressions and clicks per variant, and declares a winner once chi-square significance crosses the 95% threshold.

Variant assignment

  • Cookie-based: first impression sets oam_ab_* cookie, 30-day TTL
  • Sticky: same visitor sees the same variant on every page load
  • 50/50 split: random assignment for new visitors

Statistical significance

OAmazon runs a chi-square test on a 2×2 contingency table (variant A clicks/impressions vs variant B clicks/impressions) on every analytics page load. When p-value crosses the 0.95 threshold, the test status flips to resolved and the winner is recorded.

Pseudocode// Contingency table
//        Clicks  No-click
// A         a        b
// B         c        d
//
// chi² = ((a + b + c + d) × (ad − bc)²)
//      / ((a + b) × (c + d) × (a + c) × (b + d))
//
// significance = 1 − (1 − chi²_p_value)
// declare winner when significance >= 0.95

Test storage

Tests live in wp_oam_abtests with: name, two display IDs, accumulated clicks/impressions per side, current significance, status (draft, running, resolved), winner display ID, and timestamps.

08 · FTC Compliance

FTC compliance

Amazon's Operating Agreement requires affiliate disclosure on every page that includes affiliate links. OAmazon handles this automatically.

Auto-injected disclosures

When a post contains an OAmazon affiliate link, the plugin auto-injects a disclosure based on context. Configurable per-context (post, widget, sidebar) with position (before / after) and active toggle.

Default disclosure (seeded on activation):

"This post contains affiliate links. As an Amazon Associate,
we earn from qualifying purchases at no extra cost to you."

Manual injection

Use the shortcode for finer placement:

[oam_disclosure context="post"]

ToS checker

Built-in compliance scanner runs on the admin dashboard and flags:

  • Stale prices: cached price older than configured threshold
  • Missing review counts: affiliate links lacking required attribution
  • Price language: references like "the cheapest" or "the lowest" that violate Amazon ToS
  • Missing disclosures: pages with affiliate links but no detected disclosure
⚠️FTC enforcement and Amazon's Operating Agreement evolve. OAmazon's defaults are reasonable starting points but you remain responsible for compliance with your jurisdiction's rules and Amazon's current ToS. Review the disclosure text periodically.
09 · Analytics

Analytics dashboard

Every click is recorded. Per-link, per-display, per-variant, with device, country, and referrer dimensions for filtering and breakdowns.

Per-click stored fields

  • link_id, post_id, display_id
  • abtest_id, abtest_variant (when click is part of an active test)
  • ip_hash, user_agent_hash (hashed for privacy)
  • country_code (from geo detection)
  • device_type (mobile / desktop / tablet)
  • referrer URL
  • created_at timestamp

Dashboard reports

  • Summary: total clicks, unique links, top product, device breakdown
  • Time series: clicks-over-time line chart, 30-day or weekly rollup
  • Top products: clicks grouped by ASIN
  • Top posts: clicks grouped by source post
  • Geo: distribution by country (top 30)
  • Device: mobile / desktop / tablet split
10 · Shortcodes & Blocks

Shortcodes & blocks

Render a saved display

[oam_display id="123"]

References a display configured in the admin. Inherits all settings from the saved display row.

Render an inline display

[oam_product asin="B08N5WRWNW" display="card" style="orravo"]

Renders a one-off display without saving it. Accepts asin (single) or asins (comma-separated for multi-ASIN displays like comparison), display (any of the 15 types), style (light, dark, orravo), and locale.

Inline price & button

[oam_price asin="B08N5WRWNW"]
[oam_button asin="B08N5WRWNW" text="Check current price"]

[oam_price] outputs the cached current price for the visitor's locale. [oam_button] outputs a CTA link routed through the cloaked tracker URL.

FTC disclosure

[oam_disclosure context="post"]

Gutenberg block

A custom Gutenberg block called OAmazon Display is registered for visual placement in the block editor. The block UI exposes display selection, ASIN entry, style picker, and inline preview.

11 · Free vs Pro

Free vs Pro

OAmazon ships freemium. Free covers single-product use cases; Pro unlocks the analytics, A/B testing, and geo-routing infrastructure.

CapabilityFreePro
Maximum products10 ASINsUnlimited
Display typesCard, compact, button, widgetAll 15
A/B testing-
Geo-routing-
REST API-
AI keyword scanner-
Click analyticsBasicFull breakdowns + filtering
FTC disclosure

Pro is unlocked via your Orravo Core license. The oam_is_pro filter exposes the gate for custom integrations.

12 · Integrations

Suite integrations

OAmazon plugs into the rest of the Orravo Suite when those plugins are active, loaded conditionally on plugins_loaded.

orravo-core
Orravo Core
License gate, unified dashboard, command palette (Cmd+K)
ointel
OIntel
Affiliate analytics surfaced in the unified intelligence dashboard
oads
OAds
Cross-promotion: rotate Amazon products with native ads
omailer
OMailer
Insert affiliate cards into email campaigns and segments
oengage
OEngage
Visitor identity tracking enriches click attribution
oforms
OForms
Insert product cards into form flows (e.g. quiz results)
onav
ONav
Affiliate links embedded in mega-menu items
elementor
Elementor
Native Elementor widget for visual placement

WP-CLI commands

Registered when running under WP-CLI as wp oamazon <command>. Five command namespaces:

CommandPurpose
wp oamazon products import --file=<path> [--locale=us]Bulk import ASINs from a file (one per line) via PA-API
wp oamazon products import --asins=B08...,B07...Bulk import a comma-separated ASIN list
wp oamazon products listList cached products as a table
wp oamazon links scan-contentScan all posts for raw amazon.* URLs (managed and unmanaged)
wp oamazon links listList managed affiliate links
wp oamazon cache flush [--asin=<asin>] [--locale=us]Flush product cache (one ASIN or all)
wp oamazon analytics export [--period=30days] [--out=<file>]Export click analytics to CSV
wp oamazon health checkRun link health + ToS compliance scan
13 · Database & REST API

Database & REST API

Database tables

TablePurpose
wp_oam_productsCached PA-API product data per ASIN per locale
wp_oam_linksManaged affiliate links: slug, label, click_count, geo flag, schedule
wp_oam_clicksPer-click event log
wp_oam_displaysSaved display configurations (type, style, ASINs, settings)
wp_oam_abtestsA/B test definitions, results, significance
wp_oam_programsPA-API credentials per locale
wp_oam_keywordsAuto-link keywords (scanner)
wp_oam_disclosuresFTC disclosure entries per context

REST API endpoints

Namespace: oamazon/v1. Admin endpoints require manage_options; public endpoints are open (rate-limited at the link / display layer).

MethodEndpointPurpose
GET/productsList all cached products (admin)
GET/products/{asin}Fetch product by ASIN with optional locale (public)
GET POST/linksList or create managed links (admin)
DELETE/links/{id}Delete a managed link (admin)
GET POST/displaysList or save display configs (admin)
GET DELETE/displays/{id}Get or delete a display config
GET/displays/{id}/renderRender display HTML (public)
GET/analytics/clicksClick data by period or link_id (admin)
GET/analytics/summaryDashboard summary stats (admin)
GET/abtestsList A/B tests (admin)
GET/abtests/{id}/significanceRecompute and return chi-square significance (admin)
GET/searchSearch products via PA-API by keyword + locale (admin)

Admin menu

Top-level menu at admin.php?page=oamazon. Tabs: Dashboard, Products, Links, Displays, Analytics, Content, Compliance, Settings. When Orravo Core is active, the menu nests under the unified Orravo dashboard and registers with the Cmd+K command palette.

14 · FAQ

Frequently asked questions

Do I need an Amazon Associates account?
Yes. Sign up at affiliate-program.amazon.com for each locale you want to monetize. Each Associates account gets its own tracking ID and PA-API credentials.
Will the plugin work without PA-API access?
Partially. You can still create displays manually with hand-entered title, image URL, and ASIN, with cached pricing only and no automatic image fetch. Once your account is approved for PA-API, the live data flow turns on.
How fresh are prices?
PA-API responses are cached in wp_oam_products. The default refresh schedule re-fetches active ASINs in the background to keep prices current. Stale prices trigger a ToS-checker warning.
Does geo-routing require a third-party service?
If your site is behind Cloudflare, geo detection uses the CF-IPCountry header directly with no extra service. Otherwise, OAmazon falls back to a built-in IP-to-country map. Geo-routing can also be disabled per-link.
How are A/B test winners declared?
A chi-square 2×2 contingency test runs on every analytics admin page load. When significance crosses 95%, the test transitions to resolved status and the higher-CTR variant is recorded as the winner. You can also resolve manually.
Are click events stored with PII?
No. ip_hash and user_agent_hash are SHA-hashed before storage. The raw IP and UA are not persisted. Country code, device type, and referrer are stored in plain form.
Can I import existing affiliate links from another plugin?
Not directly. Each affiliate plugin uses a different schema. The recommended approach is to identify the ASINs in your existing content, add them under Products, then either replace the old shortcodes manually or use a one-off migration WP-CLI command.
What happens if Amazon revokes my Associates account?
Affiliate links continue to render but no commission is earned. Set the relevant program to inactive in Settings → Programs to stop new clicks from being tracked against the dead account.
Where is OAmazon data stored on uninstall?
Deleting the plugin (not just deactivating) drops the wp_oam_* tables. Take a database backup before uninstalling if you want to preserve click history or display configurations.
Can I run OAmazon alongside another affiliate plugin?
Yes. They share no schema. The only friction is the FTC disclosure: if both plugins try to inject one, the page will get duplicate text. Disable disclosure injection in one of them.
✦ Need help?

Got a question about OAmazon?

Reach out directly. Kenneth replies within 24 hours.