Your trouble could differ. But based only on what you have posted, you should check the following.
Some aftermarket starters for this vehicle won't let you plug-in the connector at the starter because the plug body interferes with the big nuts on the starter post (threaded stud).
The starter should have one big nut threaded all the way onto the empty post, just touching the starter. Then the eye-terminals slide onto the post. Then the outer big nut goes on, and is tightened to flatten the eyes to avoid false tightening.
Once those are installed, if the plastic plug will not clip-on all the way, it will eventually come loose. so check that gently. If yes, some here (including me) solved it by removing the inner big nut (installing eyes against that plastic end plate and then using just one big nut gently tightened). Then the plastic plug can go in far enough to click.
But if the inner big nut is omitted, it's possible the outer big nut can back off over time. The electric wire eye connectors get looser and looser. If you reach up to that post and the outer big nut is loose on the post then you need to remove the underbody panels and tighten it. But if you over-tighten it then the post could be pulled internally and electrical connection could be damaged.
For my part, I bought a spare ACDELCO brand starter of correct part number for my model year, got it from gmparts. Looking at it, I notice there is slightly more distance between the post and the plug body, so no interference. When mine starts to act-up again, if ever, I'm just gonna swap it.
Added:
I put my starter swap help file here, it has pictures of what I'm suggesting to check with respect to the cables and plug. See the PDF at:
Posting my help files here where I can find them. These files should work for 3.5's and most 3.9's from 2006 through 2011 and some 2012's. Some information likely crosses with other models and/or model years. Please check the GM or Chevrolet websites (or Wikipedia for Impala History) for their...
www.impalaforums.com