The findings have showed that the chance of diet lapse was about 60 per cent when eating with friends in a restaurant and almost half the time when they are alone.
However, for those eating in their own or someone else's home, the temptations to overeat is lower.
In addition, the odds of a diet lapse were lower in other locations, such as work (about 40 per cent) or in a car (about 30 per cent).
"Research into understanding and preventing weight regain is vital for improving the public health," said lead author Lora E. Burke, Professor at the University of Pittsburgh in Pennsylvania, US.
The study can guide experts in providing extra support to individuals who are overweight or obese and struggling to lose or keep off weight.
"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," Burke added.
The findings were presented at the American Heart Association's Epidemiology and Prevention/Lifestyle and Cardiometabolic Health 2017 Scientific Sessions in Oregon, US.
For the study, the team tracked 150 people (90 per cent women) for a period of 12-months using smartphones and a custom-developed application to capture data as dieters moved through everyday life.
The participants were trying to limit calories to a specific number per day. In response to questions, the dieters reported their surroundings, what they were feeling and whether they were tempted to break their eating plans.