-1

I'm looking for a javascript that allows me the function described, I would like to get removed the parameter aff_id from any url depending on visitors country:

www.domain.com/join/?language=es&aff_id=3

resulting url: www.domain.com/join/?language=es

(can be this or any other url, what matters is that aff_id=X doesn´t show for that country in particular, but it does for others)

Is this possible? Could anyone show me something similar to what I´m looking for?

Thank you in advance.

1 Answers1

0

First you need to lookup user IP-address in some geoip service (e.g. hostip.info). It can be done client-side. Check out this and this questions to get some ideas on how this can be implemented.

Next you need to substitute a part of URL. That should be simple, e.g. using location.replace.

Community
  • 1
  • 1
vbo
  • 13,583
  • 1
  • 25
  • 33