שותף Discourse

A few things I am interested in about the affiliate plugin.

Would it be possible to also make the plugin inject a notice at the bottom of the post in which Affiliate links appear? In the US and Canada (and I’m sure elsewhere) you are required to have a conspicuous notice near the affiliate link.

I think while it is doing the rebake, it would make sense to automatically insert a distinct message at the bottom of the post that says something to the effect of:

Links in this post may contain affiliate links, which help support our site at no additional cost to you.

That way the site can remain in compliance with local laws.

Another thing I would consider is adding the ability to actually remove existing affiliate links to Amazon and replace them with new versions. There are lots of official link cloakers for Amazon, the most common one is amzn.to It is not possible to just add your tag to the end of an amzn.to url as it is stripped away and replaced by the amzn.to site.

But I believe Discourse has the ability to travel through redirects and actually get to the final link? It would be within the ability of the system to look for these Amzn.to links, get the final Amazon product link it redirects to and then work backwards on the bake to change the overall link to be a direct Amazon link with your new tag built in.

Basically I just found a user had posted several articles with their own affiliate links in them and am now trying to locate them and replace them. :areyoukiddingme:

I’d be happy to help extend the existing plugin’s functionality!

EDIT:

Wrote a private plugin to test the feature. It now works as I intended. As you can see the original plugin (or something else) appended the tag to the amzn.to url, but that doesn’t actually work.

Before:

After:

It replaced it with the actual Amazon link, un-shortened and added the new (though same) affiliate tag.

And I just checked, the user’s posts that had affiliate links have all been removed and replaced with ones that actually support the site rather than enrich the user.

2 לייקים