Short version: effective actions, particularly ones obtained after integrating chiral fermions, are ambiguous up to the addition of local counterterms. Should we think of the counterterms as part of the path integral measure, or the classical action?
With some more background: Take a QFT with some Weyl fermions coupled to a gauge field, and define the effective action $W[A]$ as the action in terms of the gauge fields obtained taking the path integral over the fermions,
$$Z[A]=e^{iW[A]}=\int \mathcal{D}\psi \mathcal{D}\bar{\psi} e^{iS[\psi,\bar{\psi},A]}.$$
We say this theory is anomalous if, under a gauge variation, $W[A]$ has a transformation which cannot be cancelled by adding local counterterms to $W[A]$. My understanding of these local counterterms is that they reflect regularisation ambiguities in the path integral of the fermions. A very typical example is in 2d, where if we work with the two chiralities separately, we are free to (and indeed usually have to) add a counterterm proportional to $A_\mu A^\mu$ to make $W$ invariant under gauge transformations when the theory is non-anomalous.
In this context, I think of this counterterm as being part of the definition of the path integral measure, $\mathcal{D}\psi \mathcal{D}\bar{\psi}$, and whether it is possible to define it in a gauge-invariant way.
However, this seems to me to collide with the way I read about counterterms in introductory QFT texts, where counterterms are usually there to parametrise the difference between the bare and renormalised couplings, and therefore are already there as part of the classical action $S$, not coming from the measure. If I try to think of the above in this way, it seems to me that even for non-anomalous theories $\mathcal{D}\psi\mathcal{D}\bar{\psi}$ is not gauge-invariant, but its gauge variation can be cancelled by adding a local counterterm to $S$.
I believe the second interpretation is incorrect, but only because I'm used to think of anomalies as variations of the measure. Then a non-anomalous theory would necessarily have a gauge-invariant measure. Am I right here? Are the local counterterms part of the path integral measure? Is this also true for the usual counterterms parametrising the difference between bare and renormalised coupling constants?