PurposeThis study aims to contribute to the understanding of how elements of the socioecological system shape individual behaviors. The problem of childhood overweight and obesity is analyzed as existing within a complex system of relationships at different levels by means of system dynamics (SD).Design/methodology/approachSecondary sources and primary information collected from an elementary school were used to analyze the influences of several social environmental factors on the dietary habits and physical activity of children. The major elements that influence these behaviors were identified via a socioecological framework (SEF), and the interrelationships among these elements were described using an SD model. Then, several scenarios corresponding to social marketing actions oriented toward modifying the influence of specific elements in the socioecological system were proposed to evaluate how effective they are at reducing the percentages of overweight and obesity among children.FindingsThe current research shows the existence of counteracting efforts at the micro (family) and macro (governmental policies) levels that need to be aligned to reduce rates of obesity and overweight.Practical implicationsThe systems perspective supports decision makers in defining social marketing strategies to modify alimentary behaviors based on the understanding of what elements of the SEF influence behavior and how they interrelate. To the authors’ knowledge, a detailed analysis of the influences of the socioecological environment has not been performed based on Latin American countries to seek solutions to the public health problems of overweight and obesity.Originality/valueThe application of SD enhances the value of the SEF suggested by Collins et al. (2010) for modeling individual behaviors. Moreover, the use of the systems approach for framing and understanding how the interrelationships of socioecological elements derive in synergic or antagonistic effects helps to predict the long-term effect of governmental actions and school interventions.