Change HTML based on visitors country

Joined
Aug 2, 2017
Messages
156
Likes
96
Degree
0
Hi!

I have a good idea to implement Amazon onelink without having to worry about adblockers and speed.

I want to insert the code only to visitors outside the US.

This way I'm not hurting my earning from US visitors due to links being blocked or due to increase load time.

I want to use Cloudflare country IP data. Which is sent in a request header to the server.

I can output this with a PHP function in the HTML but the problem is that I'm using a cache plugin that creates static HTML files and this won't work properly. The country from the first visitor would be cached and it would not be accurate for the other visitors of course.

I want the data somewhere so I can use it with a simple jQuery function or something like that. Anyone knows how to do this?

Maybe turning that request header into a response header? But I don't know if jQuery can read that data.

Thanks!
 
This way I'm not hurting my earning from US visitors due to links being blocked or due to increase load time.

You may not need to do all of this. The Amazon OneLink javascript comes from the same ad server as their CPM ads, which is why it gets blocked. But it only gets blocked from executing, which means your default US links will show as they currently are.

The US visitors with ad block engaged will see your standard affiliate links. Those without ad block may see the weird javascript-affected link, but it'll be the same result. It shouldn't affect your US earnings. The real impact is if foreign users use ad block, in which case they'd end up on the US Amazon site.

If your concern is US visitors you're fine as it is. If your concern is maximizing international traffic then you may want to move forward with it.
 
Ok thanks. So there's no problem with adblock then. Are you using onelink in your sites?
 
Ok thanks. So there's no problem with adblock then. Are you using onelink in your sites?

I tested it in the early days when it first rolled out and cried about it here, and read about it in other places. The main reason I didn't keep it is because I have a custom affiliate link system using redirects that let me hot swap links on the fly across the whole site. It makes it fast to check all my links and fix any that are no longer being sold, etc. It would have taken forever to revert back to normal links and I'd lose those benefits. I tried to solve that issue with a buffer exit page and other things but I wasn't happy with that.

The second reason I don't prefer it is because their product matching system isn't that good. Genius Links seems to do a better job. I'd probably pay them before using OneLink, but OneLink is looking tastier as they keep adding countries. I think they're going to create a "global dashboard" too where all of your account's data can be linked. They asked about it on a survey anyways.

Then there was the issue of receiving payments from all the various Amazon's around the globe.

I figure I could get a 10-15% revenue lift with it, but the headaches it creates may not be worth it. I honestly forgot about it after I put it off the first time and haven't looped back around to re-evaluating it again.
 
Back