(CNN) -- Last November, avid biker Leon Shaner found himself pushing harder than usual to keep up with a new friend.
The two were locked in a fierce monthlong competition to bike at least 1,000 miles. They rode at the same time, trading small talk and stats after each ride, and urged each other on. Shaner said that because of the close competition, he doubled the number of miles he would normally have biked in a month.
The biking, sweat and pain were all real.
But the race itself was virtual. The conversations were on Twitter, the rides tracked by an iPhone app. The friend, someone Shaner had never met, lives halfway around the world in Japan.
Welcome to the new world of fitness-tracking technology.
The tech has taken off over the past few years, led by small wearable pedometers like the FitBit and Nike Fuel Band, and apps that use the GPS and accelerometers in smartphones, like RunKeeper and Endomondo.
On their own, these tools can be helpful for anyone trying to get into shape. They collect all manner of data, tracking workouts so people can set goals and self-monitor their progress along the way. That's an important factor in changing any behavior, according to sports psychologists.
But newer social features are turning the gadgets into even more powerful motivation tools. People are connecting with friends on the apps and embracing official and unofficial ways of swapping encouraging messages and trash talk, comparing workout stats, and using peer pressure and the need for approval to push each other to work out more and meet their goals.
People who have friends on RunKeeper, even just one, are two to three times more active than people who use the app solo, according to CEO Jason Jacobs. FitBit says its users who use the social features on FitBit also tend to be more active.
Working out for approval
What is it about friends that makes us work out a little harder?
When deciding how to add social features, many of the app and device makers were influenced by the research of Stanford professor BJ Fogg, who studies behavioral motivation.
Fogg said social features on fitness devices play three roles: They motivate people; the various interactions act as triggers for action; and sharing information and tips can increase ability.
Almost all fitness tracking tools now let you share your workout through the apps or on social media sites so people can see that you just finished a workout. Some even let them track you during the workout or, for example, a big race.
You've probably noticed some of these in your Twitter or Facebook feed. They might seem like a brag at first (even if they did trigger you to do some cardio). But publicly sharing workouts has real benefits, especially for people who are just getting into shape and are trying to stick to new behaviors.
"People tend to continue exercise if they feel it's approved by other people who are meaningful to them," said sports psychologist Jen Gapin.
Even light positive feedback can be a motivator, such as a simple "Like" on Facebook, "Cheer" on FitBit or a "Healthy" vote on RunKeeper, which is the app's equivalent of a like.
The RunKeeper app has a leaderboard that lets you compare your activity levels over the past month to your friends who also use the app.
If one of your less motivated friends has been inactive for over 30 days, a shaming couch icon appears to the left of their name and a megaphone button to the right. The megaphone lets you send a message to your less-active friend telling them to go for a walk, run or bike ride -- but you can only bully them once ever seven days.
FitBit also has a leaderboard but doesn't currently allow messaging through the mobile apps, though you can tweet out your progress. On the FitBit website, friends can communicate with short messages or send each other a "Cheer" or "Taunt."
"They tend to send more cheers than they do taunts, so it does tilt towards positive encouragement," said Nichiketa Choudary a senior product manager at FitBit. "At the same time we have some very interesting trash talk, more so on the playful side."
'There's no gunshot start'
Built-in social features are still in their infancy for many trackers, but the people using them are finding creative ways to communicate with friends.
Knowing that people are rooting for him keeps Dan Gillis running.
He'll post details about a run on Facebook and Twitter. And he'll share it live as on the RunKeeper app, where his friends can see stats like a map of the route he ran and his pace. He pops in his headphones and turns on the accessibility option in his iPhone so that any supportive texts and tweets he gets are read aloud while he's running.
Caleb Canal posts screenshots of graphs showing his cycling, running and walking activities to Instagram, as well as photos from workouts. Sharing small victories and receiving virtual pats on the back on social networks was especially welcome when Canal first started doing training runs for a marathon in 2010 --
losing 60 pounds in the process.
"Without a social fitness-tracking website like RunKeeper, no one would usually take notice of that run," he said. "There's no gunshot start, no water stops, no cheering crowds, and no finish line, unless it's your own driveway."
Amara Poolswasdi sometimes checks encouraging messages on her phone while she's doing long-distance running, which she says keep her motivated -- "especially when things get rough."
She started running as a challenge to herself to get in shape for a 5k and, nine months later, she completed her first marathon. She tracked her running stats and posted them to her public blog as well as social media.
People using mobile apps that don't have options for messaging, like FitBit, will take screenshots of their leaderboard and share with the friends they're competing with on Twitter or over text message. In many of these cases it's for bragging rights and a bit of light smack talk.
"Support in the form of a challenge always motivates me more than a typical 'Good Job' or 'You Killed that Ride,'" said cyclist Steve Ford, who recently completed his first triathlon.
Not just about motivation
Even when they're trading insults, friends can provide valuable information on how to improve techniques and workouts. People who live in the same area can see the best biking or jogging routes suggested by other people.
Fitness tracking tools that let you connect with strangers are a good way to pair up with people who are at a similar fitness level.
"One way that people gain self-confidence is when they see other people of similar ability doing things," said Gapin. "It helps people improve adherence to exercise."
In addition to messaging and Twitter, many people on these networks are trading tips and giving each other guidance on message boards.
"Change isn't just about motivation," said Fogg. "As important is helping people learn 'how to' and increasing their ability."
™ & © 2013 Cable News Network, Inc., a Time Warner Company. All rights reserved.