• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Amazon.com Affiliate Direct to Cart Auto Embed [Deleted]

Chris D

XenForo developer
Staff member
#1
Yorick submitted a new resource:

Amazon.com Affiliate Direct to Cart Auto Embed (version 1.3) - Automatically convert Amazon.com URLs into affiliate links with 90 day cookies

This add-on was requested by Andy-N, here: http://xenforo.com/community/threads/amazon-90-days-cookie.32494

Amazon.com run an affiliate scheme. If someone clicks on a URL to a product containing your affiliate ID you receive a commission.

Traditionally, a cookie is set on their machine for only 24 hours. Meaning they have to complete the checkout of the item found via your URL within that time for you to receive the commission.

This add-on, however, converts every single...
Read more about this resource...
 

Kevin

Well-known member
#2
Will this change existing affiliate IDs in posted links to the one specified in the ACP?

(And, yes, I mean in new posts going forward, no expectation of already posted links. ;))
 

Chris D

XenForo developer
Staff member
#3
Any new posts containing Amazon.com links will contain the affiliate ID from the one specified in the ACP.

As this is set up as a "media site" (just like YouTube and Vimeo etc.) XenForo will convert the links to something like this: [media=amazon]productcode[/media].

That won't happen to existing links (as you've pointed out) unless someone edits the post and saves it again. As the post contains the URL formatted as above, I believe that if the affiliate ID changes in the future, any past links that are in this format [media=amazon]productcode[/media] actually will get updated automatically.
 

Chris D

XenForo developer
Staff member
#5
I have an idea too that might be able to get it to work for all Amazon.com links you already have...

There's an add-on by Kier called "Replace in Posts".

Technically, it should be possible to find all references of an Amazon.com link on your site, extract the product ID and format it in the correct format for this add-on [media=amazon]productcode[/media].

I'd just need to work out what the correct regular expression is to find these links and convert them to the right format.
 

Crazyfruitbat

Well-known member
#8
Yeah this looks like a great addon. I think one thing I have always wanted with these type of systems is to have it multi-region. I have accounts for UK and USA so I'd love to be able to have a system like this and plug both amazon stores in but somehow show only amazon.com links in the US and amazon.co.uk like in the uk.

I don't know if that is even possible - just me thinking out loud :whistle:
 

Chris D

XenForo developer
Staff member
#9
It's a good idea.

I am actually just about to release an update that supports Amazon.de and Amazon.co.uk.

It will allow you to input your .com and .co.uk affiliate ID (and .de in this version) but if someone posts a .com link it will appear as .com for everyone, regardless of what country they're browsing in.

Unfortunately getting the links to display in the region of your visitor is theoretically possible - but the problem is what if an Amazon.com product doesn't exist on Amazon.co.uk?
 

Chris D

XenForo developer
Staff member
#10
Yorick updated Amazon.com Affiliate Direct to Cart Auto Embed with a new update entry:

Adds support for Amazon.co.uk and Amazon.de links

Now includes options for Amazon.co.uk and Amazon.de links. Your affiliate ID will be different for each Amazon site.

If you do not want, or do not require all of the Amazon sites, just delete the ones you don't want from BB Code Media Sites in Admin CP.

Install:

1) Extract the contents of the zip
2) Upload contents of the upload folder to the root of your XenForo directory overwriting existing files
3) Install using the XML file.
Read the rest of this update entry...
 

Andy.N

Well-known member
#11
Yorick,
Would it possible to update the addon so that it will work with this format
[URL='http://www.amazon.com/gp/product/0470580844']Reminiscences of a Stock Operator (Wiley Investment Classics)[/URL]
That is the member first enter the title of the book Reminiscences of a Stock Operator (Wiley Investment Classics) and then highlight it and add url to it.
In this case, your addon won't need to pull the title but just change the link.
 

Chris D

XenForo developer
Staff member
#12
Hi Andy.N,

No it can't work like that, unfortunately.

You could kind of describe it as a bit of a conflict of interests between BB Code Media Sites and BB Code.

BB Code Media sites' job is to convert a standard URL into a BB Code of this format: [media=Amazon]productcode[/media] and then the BB Code job is to take a BB Code and convert it into whatever it's supposed to be converted into.
 

Chris D

XenForo developer
Staff member
#14
You can change that limit in the Admin CP, but 100+ Amazon links concerns me.

The title fetching works exactly the same as Ragtek's add-on, by the way, which uses default XenForo helpers to go and fetch the content and get the title. I don't know how it's going to handle going to fetch 100+ amazon links...
 

Andy.N

Well-known member
#16
You can change that limit in the Admin CP, but 100+ Amazon links concerns me.

The title fetching works exactly the same as Ragtek's add-on, by the way, which uses default XenForo helpers to go and fetch the content and get the title. I don't know how it's going to handle going to fetch 100+ amazon links...
That will bomb out as i just found out. I have a master reading list which has 150+ books on it. I had to go to sql and edit the post manually to remove the amazon bbcode ;)
 

Chris D

XenForo developer
Staff member
#17
Ok...

I can make the title fetching a configurable option, so you can turn it off. But that means fetching the title automatically will just never work... though I will look into it a little bit more.
 

Andy.N

Well-known member
#18
Take a look at this thread Yorick. This is where my master reading list is.
I imagine if every link is turned into media bbcode, it will slow down a lot. Right now, i have less than 10 in the first post. The rest is hardcoded url
Is there anyway we can improve the performance of this addon?
 

Chris D

XenForo developer
Staff member
#19
Yes, as I've said, the performance degradation is due to it having to go and fetch the title. The solution is that I release a version where the title isn't fetched. That means the URLs will, instead of appearing like this:

Amazon.com: The Complete Guide to Capital Markets for Quantitative Professionals (McGraw-Hill Library of Investment and Finance) (9780071468299): Alex Kuznetsov: Books

It will have to appear like this:

http://www.amazon.com/gp/product/0071468293

Or something like this

Amazon.com product 0071468293

I will update it now with the ability to turn title fetching off.
 

Crazyfruitbat

Well-known member
#20
It's a good idea.

I am actually just about to release an update that supports Amazon.de and Amazon.co.uk.

It will allow you to input your .com and .co.uk affiliate ID (and .de in this version) but if someone posts a .com link it will appear as .com for everyone, regardless of what country they're browsing in.

Unfortunately getting the links to display in the region of your visitor is theoretically possible - but the problem is what if an Amazon.com product doesn't exist on Amazon.co.uk?
ohh that's great news - thanks very much.

I never thought about the difference of products between stores...