In a schematic notation, the scattering matrix element $$\langle p_{out}|S|p_{in}\rangle := 1 + i (2 \pi)^4 \delta^4(p_{in} -p_{out}) M$$ between an incoming state with momentum $|p_{in}\rangle$ and an outgoing one with momentum $\langle p_{out}|$ is by construction a dimensionless quantity, which implies that $M$ has mass dimension $4$ due to the Dirac delta factor. Now, how is this dimensionality ensured term by term in a perturbative (diagramatic) expansion, while different diagrams will contribute additive terms of different dimensionality?
As an example, in a real scalar theory with $\mathcal{L}_{int} = - \frac{\lambda_3}{3!}\phi^3 - \frac{\lambda_4}{4!}\phi^4$, the tree level contribution to $M$ for a $\phi\phi\to\phi\phi$ scattering is $-\lambda_4$, which is dimensionless, but the tree level contribution for the process $\phi\phi\to\phi$ is $-\lambda_3$, which has dimension $1$, and yet the dimensionality of $M$ should be the same for any process.
As a side note, it is worth mentioning that the question arose thinking of effective field theories, because I read a reasoning justifying that the power counting parameter should be chosen to be $p/\Lambda$, for $p$ the typical energy of the problem addressed by the EFT and $\Lambda$ the UV threshold, based on the fact that by dimensional analysis, since the probability amplitude is dimensionless and each non-renormalizable operator of dimension $d$ will contribute a factor $1/\Lambda^{d-4}$, then some kinematic factor must contribute a $p^{d-4}$ to ensure the amplitude remains dimensionless; but of course some diagrams have no kinematic contribution at all...