First try a Apple USB or Bluetooth keyboard to check to make sure it works with it.
If it does which I suspect it will. You will need to check the ribbon cable connections on the upper case and the connection to the logic board. Are you sure you disconnected the cables correctly as well as seat cable ends in fully and close the latches of the connectors. Often people forget able the latch or fail to fully insert the ribbon.
If your sure the ribbon cables are correctly inserted did you nick the cable? carefully look along where you reseated it into the case and also check where its connected to the logic board.
Lastly, it's possible the keys are damaged did you spill something into the trackpad which could have also spilled into the keyboard. Is that why you needed to change out the trackpad?