An ELL post says
That doesn't mean I necessarily am going to buy a Ferrari, it's just an option. If I said "If I won a million dollars I would buy a Ferrari", I mean that I necessarily am going to buy a Ferrari. I will buy a Ferrari.
which puts "necessarily" in between "I" and "am going to".
Per Cambridge Dictionary, there are at least eight different kinds of adverbs and these are adverbs of manner, adverbs of frequency, adverbs of time and place, adverbs of relative time, adverbs of degree, adverbs of quantity, adverbs that focus, adverbs that function as attitude markers.
Although the adverb "necessarily" is not in that list, I guess I could consider it as a degree adverb, as "necessarily" has a similar meaning to "absolutely" and the latter is in that list.
Such an adverb usually appears after modal verb, which is "am going to" in the quoted example.
So, is the following version the right position of "necessarily"
I mean that I am going to necessarily buy a Ferrari.
update: thanks to @Foogod
Google Ngram gives this plot