- 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!
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!