You’re determined to lose weight. You have an eating plan. You follow it to a T — usually. What is the biggest reason for your occasional lapses? A new study suggests it’s eating in a social setting.

One hundred and fifty people (90 percent women) who were on a calorie-restricted diet used an app on their smartphones to collect information as they went about their everyday life for a year. They recorded their feelings, their surroundings and their temptations, and they ‘fessed up when they broke their diet.

The average BMI — body mass index — of the dieters was 34. A BMI of 30 or more is considered obese.

Most of the diet slip-ups — about 60 percent — occurred when they were eating with other people and overeating in a restaurant. There were reported fewer lapses when they were in their own homes, or even someone else’s home than there were when eating out.

The odds of falling off the diet were less at work (40 percent) or when in a car (30 percent). But the study also found that when dieters were alone, they experienced a lapse in their diet nearly 50 percent of the time.

The average BMI — body mass index — of the dieters was 34. A BMI of 30 or more is considered obese. Women who weighed under 200 pounds followed a 1,200 calorie diet while those over 200 pounds were on a 1,500 calorie diet. Men who were under 200 pounds were placed on a 1,500 calorie diet, and those over 200 pounds were limited to 1,800 calories. The goal for everyone was to limit fat to 25 percent of calories.

“Research into understanding and preventing weight regain is vital for improving the public health. Helping an individual anticipate challenges and problem-solve high-risk situations can empower them to stay on track with their weight loss/weight maintenance plan,” said Lora E. Burke, lead author of the study and a professor of nursing at the University of Pittsburgh in Pennsylvania.

For obese or overweight individuals struggling with losing weight or maintaining weight loss, delivering support straight to their smartphones can be a helpful safety net.

This study was presented at a poster session at the American Heart Association 2017 Meeting in Portland, Oregon.