I am currently using the ACF repeater field for A/B testing and am using several different text options for a newsletter signup form on my client’s website. And then I am tracking each of the various options and their success using Google Analytics. This all works great.
However, I am wondering if there are any recommendations of how I could add another field to each repeater field/option where I could add in a percentage so that the options would be displayed on the site based on the percentage (right now it is just randomized). So, for example, if I had three options and one should be shown 80% of time on the site and then 10% and 10% for the other two.
It seems like I would have to somehow write to the database every time the repeater field was shown on the site so that I could log which option was shown and then check against that to determine which one to show so the percentage based usage could be adhered to.
Does that seem correct? Any recommendations would be appreciated.
You would need to have at least 2 other fields, or ways to store the information. You would need a field to set % of time to show a row and you would need some way to store how many times that row was shown and this field would need to be updated every time that row was shown.
Code your currently using would be helpful for someone that wanted to help you figure it out.