If in MyTrackingAction::PostUserTrackingAction(const G4Track* aTrack) I use the G4TrackingManager::GimmeSecondaries() method, it returns only electrons for Compton scattering events. So if a photon undergoes 5 Compton scattering events and ends up at the detector, it is still considered a primary photon.
So I ended up updating that information manually using the TrackInformation and TrackingAction classes in combination with the SteppingAction class. Specifically, I created a G4int to count the generation index and avoided changing the TrackID or ParentID to also avoid potentially messing the kernel.