  Let $\chi$ be a Dirichlet character (mod $n$) with conductor $d$. In a quite
recent paper Zhao and Cao deduced the identity $\sum_{k=1}^n (k-1,n) \chi(k)=
\varphi(n)\tau(n/d)$, which reduces to Menon's identity if $\chi$ is the
principal character (mod $n$). We generalize the above identity by considering
even functions (mod $n$), and offer an alternative approach to proof. We also
obtain certain related formulas concerning Ramanujan sums.
