Passenger figures are usually collated by the Airport, either by figures received from the handling agents, or automatically through flight information systems, probably more so the latter as systems get improved and updated. The origin station will send all necessary information via a message containing various things like the departure time, estimated arrival time, passenger, baggage & cargo figures and various other supplementary info. This info is usually fed into the flight info system which then collates all the necessary data. Some Airports do this manually still though.
If the diverted flight is effectively cancelled into the destination airport, then it's unlikely (or at least it shouldn't!) that those figures will be collated, as the flight should be cancelled. E.G MCO-LGW flight diverts to CWL. CWL will now have that flight stored in their systems, listed as a diversion. LGW SHOULD in theory change the status of it in their system to cancelled or diverted, as it will never arrive as it's original flight number. That is only in the case of the flight diverting and passengers offloading. If the flight continues from CWL back to LGW with passengers still on board, then it will either continue as it's original flight number and still be shown in LGW's system, or will have similar flight number, like an A or B flight, but it will still collate the information. The passengers should then be only shown as transit passengers (not arriving) at CWL.