This paper proposes a new panel data approach to identify and estimate the time-varying average treatment effect (ATE). The approach allows for treatment effect heterogeneity that depends on unobserved fixed effects. In the presence of this type of heterogeneity, existing panel data approaches identify the ATE for limited subpopulations only. In contrast, the proposed approach identifies and estimates the ATE for the entire population. The approach relies on the linear fixed effects specification of potential outcome equations and uses exogenous variables that are correlated with the fixed effects. I apply the approach to study the impact of a mother's smoking during pregnancy on her child's birth weight.