Some A/B tests work better when you can create lists of random contacts. This script helps facilitate that.
Instead of exporting a list of contacts, assigning random numbers, and importing, you can take advantage of the HubSpot API to do it all for you.
git clone https://gist.github.com/57a7f8828f79923dcb2f73e56dc56ab6.git hubspot-random-number
cd hubspot-random-number
gem install ruby-client
gem install dotenv
# replace the placeholder key below with your HubSpot API key
echo "HAPIKEY = YOUR_HUBSPOT_API_KEY" > .env
Open hubspot-random-number.rb
and update the variables at the top.
# this will process _all_ the contacts in your list. for large lists, be sure you
# keep an eye on API usage limits (10k in 24 hrs). divide your list size by
# 50 and that will be how many API calls this script makes.
ruby hubspot-random-number.rb