PHPackages                             flagrow/amazon-affiliation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. flagrow/amazon-affiliation

Abandoned → [fof/amazon-affiliation](/?search=fof%2Famazon-affiliation)Flarum-extension[Utility &amp; Helpers](/categories/utility)

flagrow/amazon-affiliation
==========================

Add your Amazon Affiliation tag to Amazon links

1.1.1(1w ago)5103MITPHPCI passing

Since May 23Pushed 1w agoCompare

[ Source](https://github.com/FriendsOfFlarum/amazon-affiliation)[ Packagist](https://packagist.org/packages/flagrow/amazon-affiliation)[ Docs](https://friendsofflarum.org)[ Fund](https://opencollective.com/fof/donate)[ RSS](/packages/flagrow-amazon-affiliation/feed)WikiDiscussions 2.x Synced yesterday

READMEChangelog (10)Dependencies (6)Versions (18)Used By (0)

Amazon Affiliation by FriendsOfFlarum
=====================================

[](#amazon-affiliation-by-friendsofflarum)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667) [![Latest Stable Version](https://camo.githubusercontent.com/825e69c09b46e53e62e56be6d86af75e11260c66717caf23af204d084789ea6d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666f662f616d617a6f6e2d616666696c696174696f6e2e737667)](https://packagist.org/packages/fof/amazon-affiliation) [![Total Downloads](https://camo.githubusercontent.com/964b87bd2c6544b20485dd18266b85a469309fb6a6841ddd35e85c8330fdc3e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666f662f616d617a6f6e2d616666696c696174696f6e2e737667)](https://packagist.org/packages/fof/amazon-affiliation) [![OpenCollective](https://camo.githubusercontent.com/1903c197bb0307e60d6328653532b8a6b9890b898fbc92e314ab39d699491e74/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6f70656e636f6c6c6563746976652d666f662d626c75652e737667)](https://opencollective.com/fof/donate)

A [Flarum](https://flarum.org) extension that automatically adds your [Amazon Associates](https://affiliate-program.amazon.com/) affiliate tag to Amazon links posted on your forum, so eligible purchases earn you commission — no need to ask your users to format links a particular way.

How it works
------------

[](#how-it-works)

Whenever a post is rendered, every Amazon link in it is rewritten on the fly:

- The link is normalised to `https://` with the `www.` subdomain.
- Your configured affiliate tag for that marketplace is appended as the `tag` query parameter (or replaces an existing one, depending on your settings).
- Links to Amazon marketplaces you haven't configured are left alone (or have their tag stripped, if you enable that).

Rewriting happens at **render time**, so changing your tag updates every existing post automatically — nothing is baked into the stored content.

A separate tag is configured per marketplace (`.com`, `.co.uk`, `.de`, `.fr`, …), because Amazon Associates accounts are region-specific. Leave a marketplace blank to skip it.

> **Note:** Shortened Amazon share links (`amzn.to`, `a.co`) are **not** rewritten. These point to a redirect service rather than a marketplace domain, so the real product URL — and therefore the marketplace and tag — can't be determined without following the redirect. Post the full `amazon.` URL to have your tag applied.

Features
--------

[](#features)

- **Per-marketplace tags** — configure a distinct affiliate tag for each Amazon region.
- **Keep or replace existing tags** — by default an existing `tag` in a link is replaced with yours; optionally keep the original instead.
- **Strip tags on uncovered marketplaces** — optionally remove affiliate tags from links to marketplaces you haven't configured, so no one else's tag survives.
- **URL normalisation** — `http` → `https` and bare hosts gain the `www.` subdomain.
- **Product cards** — Amazon product URLs become a compact card linking to the tagged product page (see below).

Installation
------------

[](#installation)

```
composer require fof/amazon-affiliation:"*"
```

Then enable **FoF Amazon Affiliation** in your admin panel and configure your affiliate tags.

Updating
--------

[](#updating)

```
composer update fof/amazon-affiliation
php flarum cache:clear
```

Configuration
-------------

[](#configuration)

All settings live on the extension's page in the admin panel.

SettingDescription**Affiliate Tags**One field per Amazon marketplace (`amazon.com`, `amazon.co.uk`, …). Enter the affiliate tag for each region you want covered. Leave blank to ignore that marketplace.**Keep existing tags**When enabled, a link that already carries a `tag` keeps it; otherwise your configured tag replaces it.**Remove tags on uncovered links**When enabled, links to marketplaces you haven't configured have any existing `tag` stripped. By default such links are left untouched.Product cards
-------------

[](#product-cards)

Amazon **product** URLs (`/dp/…` and `/gp/product/…`) are turned into a compact, self-contained product-link card instead of a plain link. The card links straight to the canonical product URL carrying your affiliate tag, so the click is attributed to your account.

This replaces the old MediaEmbed iframe embed. [s9e\\TextFormatter](https://github.com/s9e/TextFormatter) removed its built-in Amazon site, and the Amazon affiliate *iframe widget* it relied on was [retired by Amazon in 2022](https://affiliate-program.amazon.com/help/node/topic/GJV3KJAYNY5BQYPH) (it renders blank). A tagged product link is the mechanism Amazon still supports, so the card is built from that. Posts authored under older versions of this extension — whose embeds were stored as MediaEmbed tags — automatically render as cards too.

A couple of things to be aware of:

- **Cards always use your configured tag** for the marketplace — the "keep existing tags" setting only applies to plain (non-product) links.
- **All marketplaces are supported**, including CN, BR, MX and AU. (The old iframe embed couldn't handle those; the card builds a plain tagged link, so they work too.)
- **Prefer plain links?** Turn off **Display Amazon product links as a rich product card** in the settings and product URLs stay plain links, tagged like any other Amazon link.

Links
-----

[](#links)

- [Flarum Discuss post](https://discuss.flarum.org/d/12389)
- [Source code on GitHub](https://github.com/FriendsOfFlarum/amazon-affiliation)
- [Report an issue](https://github.com/FriendsOfFlarum/amazon-affiliation/issues)
- [Download via Packagist](https://packagist.org/packages/fof/amazon-affiliation)

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance98

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~196 days

Recently: every ~298 days

Total

16

Last Release

12d ago

Major Versions

0.5.1 → 1.0.02021-05-26

1.x-dev → 2.0.0-beta.12026-06-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/0538135c1debcef5602dce7ece027909cc832b7a6284ab9189a19aa8de98d60d?d=identicon)[clarkwinkelmann](/maintainers/clarkwinkelmann)

---

Top Contributors

[![imorland](https://avatars.githubusercontent.com/u/16573496?v=4)](https://github.com/imorland "imorland (17 commits)")[![flarum-bot](https://avatars.githubusercontent.com/u/39334649?v=4)](https://github.com/flarum-bot "flarum-bot (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![Ralkage](https://avatars.githubusercontent.com/u/2059356?v=4)](https://github.com/Ralkage "Ralkage (4 commits)")[![clarkwinkelmann](https://avatars.githubusercontent.com/u/5264300?v=4)](https://github.com/clarkwinkelmann "clarkwinkelmann (4 commits)")[![dsevillamartin](https://avatars.githubusercontent.com/u/6401250?v=4)](https://github.com/dsevillamartin "dsevillamartin (3 commits)")[![davwheat](https://avatars.githubusercontent.com/u/7406822?v=4)](https://github.com/davwheat "davwheat (1 commits)")[![matteocontrini](https://avatars.githubusercontent.com/u/2164763?v=4)](https://github.com/matteocontrini "matteocontrini (1 commits)")

---

Tags

amazonextensionflarumlinksfriendsofflarumfofaffiliation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/flagrow-amazon-affiliation/health.svg)

```
[![Health](https://phpackages.com/badges/flagrow-amazon-affiliation/health.svg)](https://phpackages.com/packages/flagrow-amazon-affiliation)
```

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

12127.5k](/packages/flarum-lang-russian)[fof/byobu

Well integrated, advanced private discussions.

59112.4k12](/packages/fof-byobu)[fof/gamification

Upvotes and downvotes for your Flarum community

4062.0k7](/packages/fof-gamification)[fof/subscribed

Additional user subscriptions for your forum

1231.7k2](/packages/fof-subscribed)[fof/sitemap

Generate a sitemap

1899.7k2](/packages/fof-sitemap)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

1936.5k](/packages/flarum-lang-french)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
