-1

for example I have 100 000 visitors how can I redirect traffic like that :

20k visitors to website A And 50k visitors to website B And 30k visitors to website C

  • 2
    Welcome to Stack Overflow! Please take the [tour](https://stackoverflow.com/tour) to find out what kind of questions Stack Overflow [is](https://stackoverflow.com/help/on-topic) and [isn't](https://stackoverflow.com/help/dont-ask) intended for. This question is [asking for a solution without attempting to show any work](https://can-i-haz.codes/). Please provide some code to help us work with you to find a solution. – Constantin Groß Oct 01 '19 at 16:41
  • Are you talking about dynamically changing a hyperlink with JavaScript? What is your specific programming problem? – Tom Faltesek Oct 01 '19 at 16:43
  • yes I want dynamic redirect – Mila Dev Oct 01 '19 at 16:56

1 Answers1

0

Either you keep count of how many people you redirected and change the link's target accordingly, or you can use the power of statistics and generate a random number between 0 and 1 - then redirect the user to A if it's less than 0.2, to B if it's between 0.2 and 0.7 and otherwise to C. That way, it also doesn't matter if you have 200k visitors or only 100 - statistically, 20% will go to A, 50% to B and 30% to C.

LePhil
  • 96
  • 6