Incrementing the analytics is part of the routine that renders the shortcode content, I see nothing wrong with that, since the shortcodes aren’t supposed to be expanded in the editor view at all!
The real question here is why does the gutenberg editor render the shortcodes in the first place? And how does it do it? I mean, the shortcodes appear unexpanded in the editor view, so surely it is some kind of a bug, right?
Keep in mind that we’re talking about random shortcodes appearing in the post body(in html blocks etc)