Factorization algebras play a central role in the formulation of quantum field theories given by Kevin Costello and Owen Gwilliam. In this paper, we propose a concrete construction of a topological operator using their formulation. We focus on a shift symmetry of a 1D massless scalar theory and discuss its $\mathbb {Z}$-gauging, i.e. compact scalar theory and its $\theta$-vacuum.