A non-transitory computer-readable medium having instructions thereon for a program for an exhaust gas sampling device, the program collecting an exhaust gas emitted from a vehicle including an engine or a part of the vehicle into a sampling bag, the exhaust gas sampling device including a main channel through which the exhaust gas flows, a main valve that opens and shuts the main channel, a dilution gas channel that is connected downstream from the main valve in the main channel and introduces a dilution gas into the main channel, a purge gas channel that branches from the dilution gas channel and has a downstream end connected downstream from the main valve in the main channel and upstream from a junction of the dilution gas channel, and a purge pump disposed in the purge gas channel, the program, when executed by a computer, causing the computer to function as
- a purge operation control unit that starts the purge pump after stop of the engine and delivers a part of the dilution gas flowing through the dilution gas channel as a purge gas to the main channel.