It's been pretty well shown that cramps result neither from loss of electrolytes nor from dehydration. Cramps come from exerting oneself harder than one has trained for, or running low on carbs late in a long ride. As above, treatment is either pickle juice or mustard or Hot Shots. It's the taste, nothing else.
I separate my food, water, and electrolyte sources. Plain water, a high carb source, and Endurolyte capsules. I drink to thirst and encourage thirst by taking Endurolytes if necessary to encourage thirst, otherwise not. I can tell if I'm hydrated: I need to pee about every 3 hours. If I'm dehydrated, my HR goes up more than usual for the circumstances. If I'm low on carbs, my HR is lower than usual.
I'll use a high carb sports drink like HEED or SIS in my water bottles on short rides of 3 hours or less. Otherwise, it's plain water. If it's a long ride in the heat, I'll use a 2 liter Camelbak and possibly bottles. I never use Gatorade.
Again, you know you're adequately hydrated if you need to pee about every 3 hours. If the ride is less than 3 hours, don't worry about it. You're actually faster about 2% dehydrated because you're a little lighter. 3% however is not OK.
Another good tell is to watch your forearms. If they're damp, you're OK. If they go dry, you might have a medical emergency unless you get some water fairly soon. Sweat is the only thing that cools you. I've had my resting HR go as high as 120 from dehydration on a long 105° climb. Luckily, I knew where a tap was and sat in the shade and drank a couple liters of water, took some Endurolytes, was fine and went on.
Everyone is different about how much electrolytes to consume vs. volume of water. You have to experiment on yourself, but that's the big reason I don't have electrolytes in my water. No matter how much is in there, it's probably the wrong amount. I take 1-2 Endurolytes an hour if it's warm to hot. I have a riding buddy who needs 6. He's your usual slim, tough cyclist, but riding behind him in the heat, you'd think it was raining.
__________________
Results matter