  Let $C$ be a projective smooth connected curve over an algebraically closed
field of characteristic zero, let $F$ be its field of functions, let $C_0$ be a
dense open subset of $C$. Let $X$ be a projective flat morphism to $C$ whose
generic fiber $X_F$ is a smooth equivariant compactification of $G$ such that
$D=X_F\setminus G_F$ is a divisor with strict normal crossings, let $U$ be a
surjective and flat model of $G$ over $C_0$. We consider a motivic height zeta
function, a formal power series with coefficients in a suitable Grothendieck
ring of varieties, which takes into account the spaces of sections $s$ of $X\to
C$ of given degree with respect to (a model of) the log-anticanonical divisor
$-K_{X_F}(D)$ such that $s(C_0)$ is contained in $U$. We prove that this power
series is rational, that its "largest pole" is at $\mathbf L^{-1}$, the inverse
of the class of the affine line in the Grothendieck ring, and compute the
"order" of this pole as a sum of dimensions of various Clemens complexes at
places of $ C\setminus C_0$. This is a geometric analogue of a result over
number fields by the first author and Yuri Tschinkel (Duke Math. J., 2012). The
proof relies on the Poisson summation formula in motivic integration,
established by Ehud Hrushovski and David Kazhdan (Moscow Math. J, 2009).
